Portals
Portals are a quick way to get back to the start of the mine. Touching a portal forms a two-way connection to the start of the mine, so you can get back and forth to the portal you found underground.
When you touch a new portal, it will replace your last portal connection with the new connection. So if you want to go back to the portal in the old connection, you'll have to go find it again.
The most recent portal you touch will keep it's connection with a portal at the beginning of the mine. You can now safely go back and forth between these two portals, until you touch another one to form a new connection.
Blue portals will connect up into the snow layer, and green portals will connect down into the mine.
You can replace a portal connection in one direction (up or down) without losing the connection you have to a portal in the other direction (down or up). Keep exploring, the deeper you go the more you will find.
Here is an example of a Blue portal going up, and a Green portal going down:
What are the portals made of? There may be more to them then meets the eye...
Portals are not the only way to get out of the mine, but they are the easiest way to get back. You can also get out of the mine using a Teleport Orb, which you can get from Wizard Nylmar in the Tavern, and if you are stuck you can use the Panic button to escape the mine at any time (but you will lose your items if you use the Panic button outside of the training mine).