Thanks for sharing your query with us.
It seems you have developed infection in your toe from where your nail got avulsed. To treat the same, you may follow these-
Clean the area with warm saline water followed by application of a topical antibiotic
cream like fusidic acid
or mupirocin twice in a day.
You may also require a course of oral antibiotics
along with oral antiinflammatory analgesic
to reduce pain inflammation and treat infection.
Kindly consult a doctor near by to get the prescription for the same.