Retirement tax questions

"I know I have to pay taxes on the earnings."

Actually you pay tax on the amount of earnings included in income.

That depends on your prior Roth contributions and conversions.

--

return of excess contribution:

before tax filing date including extension: positive earnings allocable to the excess are included in income on 1040 Line 4b for the year of the contribution. negative earnings are ignored; in any case, for purposes of basis, consider the original requested amount as returned.
For a Roth IRA, the taxable amount is found on Form 8606 Line 25c. See Note1

 

--

Note 1: When you take excess plus positive allocable earnings from a Roth IRA,

you have to use Form 8606 to determine the amount to include in income.

It may be zero.

If it is zero you have to update your records for basis in Roth IRA by subtracting the allocable earnings.

 

@Evergreen50