ra4king has got it pretty much perfect strategy-wise. I would only add to that that it’s a lot cheaper to colonise than to invade, so at the start of the game, rapidly colonise anything that isn’t Poor or Barren, and fortify each planet just after colonisation - as otherwise the computer will grab it from you.
The other thing worth mentioning is that the formula for how many ships you lose when attacking means that if you want to lose no ships at all, the number of attacking ships must be three times the number of the defences. (Planetary defences plus any fleet present.) And you can lose up to half your ships when attacking, so don’t get into too many narrowly won battles, or you’ll spend all your time rebuilding your fleet.