The approach to investment return and risk varies with the investor and their stage in life. A prudent investor that does not need to access their investments for twenty years might be willing to accept higher risk in return for higher long term gains. A prudent investor who is near or at retirement age would have much less tolerance for risk.
The Holy Grail of investing would be market (e.g., S&P 500) returns or better with much less risk (like the Holy Grail, this is generally unattainable).
This Jupyter notebook investigates a stock market trading algorithm that is often referred to as ETF rotation. The ETF rotation algorithm has less risk and, in some cases, better returns than a "buy and hold" algorithm (see All Weather" Portfolios) For example, the ETF rotation algorithm described in this notebook had higher returns with less risk than the S&P 500 for a portfolio investment that started in 2008 to 2019. After 2019 the return of the ETF rotation portfolio was equal or less than the S&P 500.