Applying a credit memo to an invoice is easy and can be accomplished by following the below steps:
Open the document (quote, order or invoice)
Click receive payment
For payment type, select credit
Select the credit memo you would like to apply (if there are multiple)
Click Apply payment
The payment should be visible in the document timeline