Fixing excess Roth contributions for a previous year

I took out excess Roth contributions before the tax deadline for 2021 but failed to take out the appropriate earnings (accidentally). How can I go back and correct this now?