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 like Metamask 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 like Metamask 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 Ethereum transaction fee.