If your Uniswap transaction has been pending for a long time, you have three available options.
Wait — the Uniswap interface has a default transaction deadline setting of 20 minutes, after which the transaction will automatically fail. Once the transaction has failed, you can resubmit your transaction.
Speed up — wallets can offer users the ability to speed up their transactions by re-submitting them with a higher gas price. This is not necessarily guaranteed to work. (Metamask guide)
Cancel — wallets can also offer users the ability to cancel their transactions by submitting an ‘empty’ transaction with a higher gas price. This is not necessarily guaranteed to work. (Metamask guide)
Note that all three options will have an associated transaction fee.