It can be ingrown toe nail(onychocryptosis).
Because of which there might have been an infection.
Infection has to reduced and if there's is an abscess it needs to be drained by a Dermatosurgeon or a general surgeon AS EARLY AS POSSIBLE.
Next Steps
to reduce infection and proper prescription of pain killers to relieve pain and antibiotics, consult or chat with me online/any dermatologist
Health Tips
Do not cut the nails too deep as it increases the chance of ingrown toe nail.