Is there any way to better react when someone is hurt?
Unless you have professional knowledge in health care, I don't think you can be more than just a temporary support to them. You can show that you're concerned, and willing to help. Hopefully, doing some of the following will help you and the other person:
- stay close enough to help if the person want to stand up or need something.
- ask them if they want you to call for some help(*) if pain is too big.
- ask them if they want to try and stand up (with or without your help) or prefer to just sit on the ground for a moment.
- if they stand up, ask them if they can put some body weight on the injured ankle, and if it allows to go to the nearest chair/bench.
I would just avoid the awkward thing you listen to too many times when this happens: "Are you ok?". Obviously, NO, they are not, as they just hurt themselves and feel pain...
Doing sports for a long time, with friends or coworkers, I've been in this situation (both sides), and we almost ended up doing something like the above. Nothing more, nothing less...
* Many countries (all? I guess) have dedicated numbers in case of medical emergency. But it can also be calling a friend/SO to come and pick them up,
or take care of their car.