If you want to cancel a transaction from Bitcoin core there is a way to remove those unconfirmed transactions but I don't know if it will work if it still on the mempool.
Anyway, you can try it and once it's successful you can able to make a new transaction.
Since the -zapwallettxes was removed on the latest version of Bitcoin core you can try this method below.
- Open Bitcoin core
- Go to window>console
- Now type this command
abandontransaction "YourTXID"
Once it's done you can able to respent or make a new transaction.
Or if you are running with Bitcoin-cli(Without GUI)then the command must be this
bitcoin-cli abandontransaction "YourTXID"
thanks a lot, funds was back to the wallet. So now it is necessary to create a new transaction with the same inputs of the failed transaction, I think right?