There are just some few thing to do to avoid losing in the market.
First, understand the market and build your skills.
Avoid the noise and trade the signals.
Be comfortable in your own decisions.
Avoid emotions and have a good risk management.