Excess Contribution Withdrawal Roth IRA

Hi there! In January 2023 I put $6k into my roth ira (marked as a contribution for 2022). I realized since I got married I couldn't contribute anything so withdrew the $6k PLUS the $144 interest it had earned and marked it as excess contribution (all of this happened in the span of 6 days)

 

I received two 1099-INT for these for 2023:

$6000 code PJ (taxable amount 0) 

$144 code 8J (taxable amount $144)

 

My question is do I amend my 2022 return or file this as part of my 2023 return? The bank transactions happened in January 2023 but I deposited the funds and marked them for my 2022 roth contribution so a bit confused which tax year these apply to (or if they both even apply to the same year?)

 

Thanks!