I'm not going to go into details, since there are several good tutorials out there. But an interaction with the Etherum Protocol has Gas Limit and Gas Price.

The gas is the fee paid in ETH to the miners to maintain the Ethereum blockchain.

Gas Limit

This is the maximum amount of gas that you are willing to spend. Sending ETH will require very little gas, compared to interacting with a smart contract. A smart contract will use more or less gas, depending on the complexity of the functions.

<aside> ☝ Gas Limit too high: don't set the Gas Limit too high. If you do, miners might not include the transaction in the block, since blocks are prepared with the gas limit (and not the actual gas that's going to be used).

</aside>

<aside> ☝ Gas Limit too low: If you set the limit too low (for the contract your trying to execute), the contract will run until the gas runs out, it will revert the transaction, and your transaction would have failed (insufficient gas) and you will have lost your gas.

</aside>

Gas Price

This is how much you're willing to pay for each unit of gas used. Usually the wallet will give you a "default", but it's always a good idea to check what the market price is. Miners will pick the transactions with the highest gas price first, as that's the fee that the will be receiving. Hence, the higher-priced transactions are (usually) mined first.

<aside> ☝ Gas Price too high: If you price your transaction to high, you will overpay (and make some miners extremely happy).

</aside>

<aside> ☝ Gas Price too low: If you price your transaction too low, it will be thrown back in the line, and might be stuck there forever (or a very long time).

</aside>

Unsticking a Pending Transaction

Check for Gas prices using any of the tools:

Gas

Gas Cost

$$ Gas Cost= Used Gas * Gas Price $$

The amount that you will pay for a transaction is a function of Used Gas * Gas Price.

A Practical Example

<aside> 🙏🏼 Credit to @Crypto_Patoruzu

</aside>

A basic transaction, from wallet to wallet, consumes 21k units of gas. This might vary depending on the type of transaction, the quantity and type of operations to be executed.

The cost of a transaction in Ethereum is measured in gwei per unit of gas, where: