Issueing a credit note for a sales invoice may be required because the client sent back goods, you've negotiated a reduced price, or something was incorrectly entered on the invoice. Completely voiding a sales invoice is only necessary in a few situations, so using credit notes is our preference.
Xero's Support page provides the specific instructions here.
If you'd like to learn about the differences between cancelling, deleting or writing off an invoice (bad debt), take a look at this Xero link.