I dove to the bottom of the ocean and made a little pocket of air for myself. Then I started digging for stuff. Now that my bag is full, I want to get back to the surface so I can teleport to my ship, but I can't seem to swim fast enough to the surface, how can I get back to the surface easily? Is there anything that can help me with this in the future? (Other than a teleporter)
You'll have to build a tunnel of solid blocks.
To do this, stand just under the Ocean floor, and use your Matter Manipulator to place a 4xN column background tiles directly above you. Once you've placed the background tiles, place foreground tiles in the same place. Then, hollow out your column (being careful not to breach the ocean as you do so!)
Placing the foreground blocks will destroy the liquid, and placing the background blocks will prevent the ocean (which is infinite) from filling the space back in.
Sable Dreamer already explained how to get out of this mess when you are already in it. But I would like to answer the question about how to prevent this mess from occurring in the first place.
Next time you want to go diving, equip an EPP unit on your back. It doesn't just provide air on airless moons and asteroid fields but also when under water. When you would like to explore the poison oceans of toxic planets (you maniac), craft a lot of poison antidote at your Apothecary / Medical Station. It makes you immune to the poisoned status effect for 5 minutes when consumed, so you can safely swim in them (it doesn't help against the acid rain on the surface, though).