Here you can learn about the difference between Cancelling & Unposting a voucher.
If the voucher status is in Created status, you can change the voucher status as Cancelled.
You can click below link for voucher Cancellation
If the voucher status is in Posted Status, you cannot have the option to Cancel the voucher, So you have to Unpost the voucher.
You can click below link to Unpost a voucher.