Mining can be done in space with your ship, or on planets by yourself. The only major difference between the two is where your mined things end up.
Below is a Territe Deposit. The easiest place to find these is underground on an Azure planet. In general, right click on things to see how you can interact with them. If you right click on something and see a 'Mine' button, it's safe to try mining that! If you, the player, are mining something, the material mined goes into your inventory.
You can mine from your default pod! As you fly around the galaxy, you will find things smaller than planets. Right click on things, and if it's an asteroid, comet, or something else that can be mined, you will see a 'Mine' option pop up.
You'll get a cool beam showing that you are mining!
The material mined from your ship won't go into your inventory - it will go to your ship. It won't neatly stack, so soon you will have a floor full of material, and the ship will stop mining. You can manually collect everything, or build a container (Bulk Container for most things, Ice Container for ice), and your ship will automatically put the material in the appropriate container.
The Complexity system applies to mining. If your mining skill is low, you will sometimes get messages that your beam is a bit weak. This is OK! It will just take longer to mine.