It seems that you may be having onychomycosis
It is fungal infection
However,diagnosis should be confirmed by KOH scrapping for fungus.
After confirmation, antifungal tablets like ketoconazole may be taken.
Antifungal lotion like clotrimazole
lotion may be applied.
You may be recovered after long treatment , about 6 months.
Do all this after consulting dermatologist
I hope you got my answer.
Dr. Ilyas Patel MD