I withdrew my 2021 excess Roth Ira contribution + earning before filing 2021 tax in April 2022. In 2023, I received the 1099-R with code PJ. What should I do for TY 2022?

My wife also withdrew 2021 non-deductible IRA with loss before filing 2021 tax. She received 1099-R with the code P1. How do we report the earning (in my Roth) and the loss (in my wife's IRA) in 2022 tax? Do we need to amend 2021 tax?