Sometimes doing sport I feel pain in the ankle, what can I do?

Further evaluation. The cause of your discomfort may be from many possible causes. A sports medicine physician can determine the cause and what previous injuries, medical history, or mechanics may be contributing. They will provide you with a customized answer. If you have a little instability from a previous sprain, a neoprene brace may be useful in addition to strengthening and proprioceptive exercise.
Pain. As stated, get an evaluation and see what is causing that pain.
Monitor it. Occasional pain is not unusual. However of the pain becomes more persistent or prevents you from playing then you should have it looked at. Hard to give you more specifics for a general question.