Customers may not be satisfied with the product bought online and may want to return it. In the case of Magento 2 stores, there is a default facility of credit memos for the refund purpose.
Read step by step method to create and print a credit memo in Magento 2 at https://meetanshi.com/blog/create-credit-memo-in-magento-2/