What is the best way to backtest a trading strategy?

How can one effectively backtest a trading strategy to ensure its reliability before live execution?,