To be able to breathe on other planets without a Space Suit, you will need to set up an Oxygen Distributor. They create a breathable atmosphere, allowing you to set up Moon bases and easily survive in otherwise hostile worlds.
Crafting the Oxygen Distributor
Firstly, it’s important not to confuse the Oxygen Distributor with the Oxygen Loader. An Oxygen Distributor distributes oxygen nearby, creating a breathable artificial atmosphere. The Oxygen Loader is used to load either Space Suits or Oxygen Tanks, which is also necessary for exploring other planets.

Crafting an Oxygen Distributor requires 3 Engine Fans, 2 Oxygen Tanks, 1 Oxygen Loader, 1 Oxygen Gear, and 2 Desh Plates. Most of these ingredients can be obtained from the Overworld, except Desh.
Desh can be mined on the Moon. So it’s a good idea to bring filled Oxygen Tanks to explore the Moon for an hour or so while you set up a temporary base and mine Desh, which can be found deep underground.
Powering & Distributing Oxygen
Before creating a breathable atmosphere, the Oxygen Distributor needs to be powered. Craft a Coal Generator and place it adjacent to the Distributor, or connect it with Steel Cables. Place Coal in the Generator, and the power will transfer to the Oxygen Distributor.

The far-right bar will fill up if the Oxygen Distributor has received energy. Ensure the Oxygen Distributor is in an enclosed space, like a room. Otherwise, it will fill an area 3000 blocks wide with oxygen, causing resources to deplete rapidly. Oxygen will disperse if a door is opened or a block is missing.
At the top of the GUI, you can see how much oxygen is being distributed. The screenshot above shows an area of 158 blocks being filled, which will update each time the machine releases oxygen.

For the Oxygen Distributor to create Oxygen, Buckets of Water must be placed in the top-left slot. So whenever exploring a new world, make sure to bring multiple Buckets of Water, as many as possible. This should hopefully allow you to generate a few minutes worth of oxygen.
Eventually, you can set up a system similar to the screenshot above. A Water Pump sucks up water from a 3-block-wide infinite water supply, automatically moving it to the adjacent Oxygen Distributor. While on either side of the Oxygen Distributor and Water Pump is a Coal Generator to power them.
When placing down water on planets like the Moon or Mars, it will be voided immediately, whether by freezing or evaporating. Water can only be placed down in an artificial atmosphere filled with oxygen. So place Water Buckets inside the Distributor first to emit Oxygen, then place down Water source blocks.