By being in a country that is a nuclear armed superpower with veto rights on the UN Security Council. Stuff like outer space treaty only matters when the bigger players are willing enforce it.
This is why chemical weapons treaties are signed and obeyed, while land mind treaties are not: the military of powerful countries doesn't seem chemical weapons as something they want, while landmines are useful in some situations. (If your country has signed a land mind treaty it is probably because they can count on an allied country that hasn't to place land mines. If your country hasn't signed a chemical weapons treaty it is because your military isn't very good by modern standards and so you can accept the downsides)