Roth withdrawal

Hello. I have a Roth for about 10 years now. I found out that I was not qualified to contribute for 2020, 2021, and 2022. I asked for the excess to be withdrawn after I already filed my 2021 tax. In 2023 I received three 1099R. One with 8, J codes, one with J code, and one with J,P codes. I entered all three forms into Turbo when I’m doing my tax this year, and haven’t amended my 2021 tax yet. I have several questions. 1) do I need to amend my 2021 tax before I do my 2022? 2) for the box Roth IRA contributions prior to 2022, do I take all my contributions in prior years minus 18000 for those three years (my contributions ended up to be a loss) so the amount shown in 1099R gross distribution are less than what I actually contributed. On the box excess Roth IRA contributions for prior years do I include 2021 excess also even though I haven’t filed the amended return? Thanks.