- Return the check, and
- take back the receipt (so the other guy can't come back later, present the receipt and demand money back) for the check payment.
- Issue him a new receipt for cash.
- Note on your copy of the old receipt what happened, and the new receipt number so that anyone looking at the old receipt knows what happened, and where to look for the new receipt.