How to Modify or Cancel a Pending Ethereum Transaction

You cannot edit a transaction that has already been broadcast - Ethereum has no undo. What you can do is overwrite it. Send a new transaction from the same address carrying the same nonce and a clearly higher fee, and the network takes the new one and drops the old. That is all any "modify" or "cancel" button does, and doing it by hand is the fallback when the button is greyed out or missing.
Find the nonce first
Every pending transaction has a position number, and you need it exactly. Paste your address into a block explorer such as Etherscan, open the pending entry and read the Nonce field. MetaMask shows the same number under the transaction's details. If several of your transactions are stuck, take the lowest nonce - that is the one blocking the rest, and clearing it usually releases the others behind it.
Overwrite it by hand
Switch on the custom nonce setting in your wallet, then start a new transaction: send 0 ETH to your own address, type the stuck nonce into the nonce field, and set the fee twenty to thirty percent above what the original offered. Confirm it. When it lands, the original is gone. To modify rather than cancel, send the corrected payment instead of the empty one - same nonce, higher fee. Customising the nonce shows where the setting lives.
If it still will not budge
Check three things. Your balance must cover the new fee, or the replacement never leaves the wallet. You must be on the network the transaction was sent on - a payment stuck on Arbitrum cannot be replaced from Ethereum mainnet, because each network counts nonces separately. And if the explorer marks the old entry "dropped and replaced", the job is already done and the wallet is showing you stale history.
Try this once with a tiny amount on a quiet evening, before you ever need it under pressure - the muscle memory is worth more than the instructions. And never resend the original payment while it is still pending. The built-in buttons remain the easier route whenever they are available.