U.S. stocks went on a bumpy ride in 2022. But although the market has risen remarkably since New Year’s Day, it hasn’t always been smooth sailing.