A credit note is essentially an invoice with a negative value - if you issue an invoice for £1000 and a credit for £50, then your total sales add up to £950.
You can create credit notes to represent cases where you’ve actually sent a refund, or cases where you’re simply reducing the amount the customer needs to pay you. For example, I run a shop, I order £500 worth of goods from a wholesaler and they send me an invoice. Then when the goods arrive it turns out that £50 worth of the items are damaged or missing, I contact the supplier and they send me a credit note for £50, then I pay them the £450 balance.
Or if I’d already paid them the full £500 before the delivery arrived then I might use that £50 credit note to reduce the amount I pay them next time I order from them.
A good rule to stick by is not to modify an invoice that you have already sent to a customer - if you need to reduce what they owe then issue a credit note rather than modifying the original invoice. This is particularly important if you’re VAT registered as it removes any ambiguity between you and the customer as to exactly how much VAT they’re entitled to reclaim.