Three painful lessons for investors in 2022. How to put them to work in the new year