You can attack monsters, objects, npcs, and other players. There are some restrictions, but the basics are you Right Click on what you want to attack, then click the 'Attack' button
Some monsters are aggressive, other's won't attack you unless you attack them. Still others may just run away. If a monster has a yellow box around it, that monster is actively attacking you. If a monster has a red box around it, that is the monster you are attacking.
Your defense is divided by the number of attacks you have defeneded this attack round. This makes being surrounded by many enemies extremely dangerous
Lets say you have 10 defense. For the first two monsters, your defense is 10. For the 3rd monster hit, your defense is 10 / 2 = 5. For the 4th monster hit, your defense is 10 / 3 = ~3.33 which we round up to 4.
Your pod can't attack other player's ships. Pods are free. If you lose your, you'll be gifted another.
You won't be able to be attacked, or to attack, when standing on a Spaceport tile
Some planets or space stations might have an owner that restricts who you can attack. For example, on the Azure planet, Cadian doesn't allow attacking his property ( anything he has built ) or other players. If a planet or space station has a restriction, it means there is an advanced AI on the planet/ship, and this advanced AI will use energy to enforce the rules.