If you already have an existing credit note recorded in QuickBooks Online, you can apply it to an invoice when receiving a payment.
If the Automatically apply credits feature was automatically turned on from the Accounts and Settings page, the credit added will automatically be applied to the invoice.
For additional reference about entering and applying credit notes to invoices, read this article.
Reach out to me if you have any other questions. I'm always here to help. Have a good day!