Sometimes a transaction gets stuck. The blockchain explorer shows "Pending" for hours, and panic sets in. Don't worry; your funds aren't lost, they are just waiting in the mempool.
Why Transactions Fail
The most common reason for a stuck transaction on networks like Ethereum is setting the Gas Fee too low. Miners prioritize transactions that pay more. If you paid too little, your transaction gets pushed to the back of the line.
Using Replace-By-Fee (RBF)
If you are using a modern wallet (like MetaMask or Electrum), you can use the RBF feature. This allows you to broadcast the exact same transaction again, but with a higher fee attached. The network will override the old, stuck transaction with the new, faster one.
Resetting Wallet Nonce
If RBF isn't an option, you can send a transaction of 0 ETH to your own address, using the exact same "Nonce" (transaction ID number) as the stuck transaction, but with a high gas fee. This cancels the pending action.