TL;DR
If you've ever used the Ethereum network, you've probably seen a transaction that takes longer than usual to confirm. This happens due to the way miners prioritize transactions – users who offer higher rates get priority.
If your Ethereum transaction gets stuck due to very low Gas fees, you will have to wait until the fees drop and the miners finally process your transaction. However, you also have the option to replace the pending transaction with a new one with a higher Gas price. Does it seem complicated? It's easier than you think. And it works with Ether (ETH) and all ERC20 tokens.
Introduction
Firstly, remember that it is not possible to replace, reverse or cancel transactions that have already been confirmed. However, during periods of network congestion, some cryptocurrency transactions may get stuck. When transaction volume is very high, your transaction may be pending for hours or even days.
Sometimes this problem goes away naturally – either because the pending transaction failed or because Gas fees decreased. While it is not possible to directly cancel a transaction on Ethereum, there are some steps you can take to speed up the process. In reality, you simply replace a pending transaction with a new one that pays higher fees.
In this guide, we will show you how to speed up transactions using MetaMask or Trust Wallet. You can also use other cryptocurrency wallets that support the Ethereum blockchain, but the process may be slightly different.
Requirements
MetaMask ou Trust Wallet installed.
Private keys (seed phrase) to access your Ethereum wallet.
Internet access.
Why did my Ethereum transaction get stuck?
Ethereum works with an auction system for its transaction fees. The fee will depend on the complexity of the transaction (i.e. the amount of computational work required). In this context, there are three important terms that you should know: Gas cost, Gas price and Gas limit.
The computational tasks of a transaction are measured in terms of Gas cost, while the price paid for each unit of Gas is the Gas price. We can think of the cost of Gas as the amount of work required and the price of Gas as the price paid for each "hour of work". Finally, the Gas limit is the maximum amount you are willing to pay for a transaction.
Although the cost of Gas is defined by the complexity of the transaction, you are free to set your own Gas price and limit values. The total fee paid will then act as an incentive to miners. However, if the Gas price is too low, your bid may be outbid by other users, leaving your transaction pending. When there is a stuck transaction, Ethereum does not confirm any new transactions made with the same wallet address until a miner confirms the previous transaction.
How to speed up a transaction on MetaMask
1. Log in to your MetaMask wallet containing the pending transaction. If you are using an external wallet, you must import the address using the corresponding Seed Phrase or private key.

2. Find the pending transaction in the [Activity] tab and click [Accelerate].

3. This process allows you to transmit your transaction again. Make sure you use a higher Gas price by clicking [Quick] and then [Save].

4. If the previous step doesn't work, you can also go to the [Advanced] tab and set the Gas price manually. You can check the current Gas price and average confirmation time on Etherscan or EthGasStation.
How to replace a transaction in MetaMask
1. Log in to your MetaMask wallet containing the pending transaction. Again, if you are using an external wallet, you will need to import the address using the corresponding Seed Phrase or private key.

2. Find the pending transaction in the [Activity] tab. Click on it to check the details and note the value of [Nonce].
Note: If you have multiple pending transactions, you should start with the oldest one first (smallest nonce value).

3. Then go to MetaMask [Settings] and click [Advanced].

4. At the bottom of the page, enable the [Customize transaction nonce] option.

5. Go back and click on the wallet address to copy it to the clipboard.

6. Click [Send] to create a new transaction and paste the wallet address into the [Add Recipient] field.

7. You need to send 0 ETH to your own wallet using the pending transaction nonce (which you wrote down in step 2). When you are ready, click [Submit].
Note: If the Gas price is too low, this transaction may also get stuck. Make sure you set a reasonable gas price.

8. Wait for the new transaction to be confirmed, so that the pending one is replaced.
Note: To avoid accidents, make sure to toggle [Customize transaction nonce] back to OFF.
How to cancel a transaction with Trust Wallet
1. Click on the pending transaction in your Trust Wallet app and search for the [Nonce] field. Note the displayed number.

2. Create a new transaction and add your wallet address in the recipient address field, [Recipient Address]. Make sure it is the same address as the pending transaction. Set the amount in [Amount ETH] to 0 and click [Next] to proceed.

3. Access settings in the top right corner.

4. Replace the [Nonce] field with the value noted previously. Make sure you set a high enough [Gas Price] so your transaction doesn't get stuck again.

5. Wait for the new transaction to be confirmed, so that the pending one is replaced.
Final considerations
It can be very frustrating to create an Ethereum transaction and find out that your Gas price has been surpassed. The situation gets even worse when you realize that you cannot use your Ethereum wallet until the pending transaction fails or is confirmed.
Sometimes stuck transactions end up being released when network fees drop. But this may take some time. Fortunately, you can cancel a stuck transaction by executing it with a simple zero token transfer. Remember, you will need to pay enough Gas fees to successfully cancel the transaction.

