Most of the serious conditions that cause swollen ankles (such as having a heart that's really struggling to do its job) result in
both ankles swelling and usually without any significant pain.
A single swollen ankle, with accompanying pain, is far more likely to be the result of a physical injury. (I'm assuming that you've not got hot, swollen skin, which would suggest an infection). It's surprisingly easy to sprain an ankle, or even to break it, without noticing it at the time but only later.
If your skin is hot and swollen (suggesting cellulitis), call 111 for advice, as you might need some antibiotics fairly urgently. Similarly, if you're running a temperature, call 111. Otherwise follow the advice here (which won't do any harm anyway), take some painkillers and see if the problem eases. If not, contact your GP.
https://www.nhs.uk/conditions/sprains-and-strains/