How do you avoid curve fitting when testing strategies?

 
Backtests often look perfect but fail in live trading. I know overfitting can cause this, but what step-by-step practices help you avoid it without losing potential?
 
Did you search on the forum ? Such topic has been discussed numerous times.