This is a really good question actually; if anything it's the most important question. The number 1 aim of any trader has to be to avoid blowing up.
If you can't lose then you can only win.
There is so much that could be written about this, but it all boils down to this: Don't risk much on any one trade. Ensure you know what you are risking on any one trade. And if you can't afford to take the trade without that risk, don't take the trade.
Some will argue that you shouldn't risk more than 2% of your account on any one trade. I don't buy that, personally - in fact in certain circumstances I think it's reasonable to risk well over half your account - but I would say that you are much better off sticking to that figure (or try 5%) than not.
So use stops, work out where your stop will be, and then size your position accordingly 🙂