This is a good question and one that is best answered by your primary care doctor
or other doctor specializing in foot and ankle medicine such as an orthopedic surgeon
. In general, it is very possible that you sprained your ankle from the description you have provided but because the history is limited (it is unclear your age, comorbidities, and any other related issues you are having), it is best that you are evaluated by your primary care doctor who can perform a thorough evaluation of your foot and ankle and decide what further tests would be appropriate or if it appears to be a sprain, and the treatment of that. While you are waiting to see your doctor, you can consider some symptomatic treatment of the pain which would include resting your ankle, applying ice to it, elevating it above your heart to get the swelling down, and applying compression to it to decrease the swelling. If you develop worsening pain, weakness, or any other issues, it is important that you are evaluated more urgently as this could be signs of something worse like a fracture
in the bones in your foot. Because it is difficult to know what this is, it is important that you be seen as soon as you can.