Thanks for your help, I am using Electrum wallet
Provided you have not been rebroadcasting, some Electrum servers will already have dropped your transaction. Go to Tools -> Network and connect to different servers until your unconfirmed transaction changes to saying "Local". You can then right click on your transaction and delete it, and then make a new transaction spending those coins.
Note that if you delete the transaction but
don't make a replacement paying a higher fee, the original may still confirm in weeks or even months if the mempool clears.