Whenever you submit a transaction on Ethereum, your gas price is a bid to the network to process your transaction sooner.
If you submit with a low gas price, you can find your transaction taking a long time to process!
In this case, you can either wait until the network is willing to process transactions at this price, or you can click that button that says "Speed Up". This will let you re-submit the same transaction, but for a higher fee that should be processed faster. To cancel the transaction, simply select "Cancel". Please note, a cancellation can only be attempted if the transaction is still pending.
For advice on what gas prices will be mined in a reasonable amount of time, refer to Eth Gas Station.
If you've tried the steps above but are still unable to cancel your transaction(s):
You can also try enabling Custom Nonce in advanced settings of MetaMask, then send a new transaction. In the new transaction you can send TO yourself, meaning your MetaMask public address. Then in the nonce set it to the last transaction nonce that is still pending, and set gas higher (to what is recommended on https://ethgasstation.info/). ETH amount can be left at 0.
If none of the options above work, you may need to reset your account:
The MetaMask activity feed may not align properly with the actual state your account is in. You can verify this by looking at MetaMask's activity and compare it to Etherscan. If transactions are shown as pending on MetaMask, but NOT on a block explorer such as Etherscan, then it is likely you will need to proceed with the steps found here.
Note: prior to resetting, we recommend you download your state logs and send them to our support so we can troubleshoot the root cause.