Re: Russia's illegal invasion of Ukraine,
As Oglethorpe has posted, one way is with a UN resolution.
I believe that there are also legal reasons to permit one nation to invade another - I think (not certain) that the Tanzanian invasion of Uganda was considered legal, since it was effectively to overthrow a genocidal maniac (but possibly also it was deemed to be in response to acts of aggression by Uganda).
I think post WWII, wars launched with the intention of permanent territorial gain were deemed to be wars of aggression, and therefore illegal (please don't hold me to that - it's a dim memory of what I once read a long time ago). Since Putin intends to annex Ukraine, it's a war of aggression, and therefore illegal.