To cancel and refund an unshipped order in Temu due to being out of stock, first you have to copy the Temu Order ID which starts with 'PO' from the CS Backend.
Then go to Seller Center page in Temu, click Orders, select Manage Orders and search for the order using the Temu Order ID.