Most web3 wallets support advanced gas controls, including Metamask. Some general guidance is provided below for your convenience – for more specific information regarding advanced transaction and gas controls for your wallet, please see the documentation on that wallet's website.
Gas is the unit of measure for how much computational work is required to process transactions and smart contracts. Essentially a transaction fee, the term originates from Ethereum, in which context it refers to computation undertaken on the Ethereum Virtual Machine (EVM). Since Ethereum was founded, numerous EVM-compatible networks have emerged and adopted similar models.
The term can be considered analogous to the gas that powers a car engine: it's the fluctuating, occasionally expensive cost of operation. Depending on the timing of your transaction, there can be significant differences in the gas cost of a transaction.
Using Your Wallet's Gas Controls
Most wallets, including Metamask, support gas controls to help you minimize your network gas fee. These may include:
The gas limit: The gas limit is the maximum amount of gas you are willing to spend in order to carry out a transaction or EVM operation.
The max priority fee: The max priority fee, also referred to as the "miner tip", goes to the miner or validator, and incentivizes them to prioritize your transaction. Most often, the value you put in for "max priority fee" will be the amount you pay.
The max fee: The max fee is the total, global amount paid for your transaction: base fee + priority fee.
For more information on how these controls work with MetaMask, see this guide.
Speeding Up or Canceling Pending Transactions
When you submit a transaction on Ethereum or other smart contract network, your gas price is a bid to the network to process your transaction. If you submit with a low gas price, your transaction may take a long time to process. For advice on what gas prices will result in a transaction being finalized in a reasonable amount of time, refer to sources such as Etherscan's Gas Tracker, or a similar tracker for whichever network you're using.
Depending on the wallet you are using, they may offer controls to help you speed up a pending transaction by increasing your gas bid price, or canceling your transaction so that you can retry at a different time of your choosing.
For information on how to do so with MetaMask, see this guide.