It can be painful if you wear tight fitted shoes/small size shoes. Or due to any injury or hit to the toe.
Get an x-ray done if it was injured to ensure that there is no fracture. If its fractured, go to an orthopaedician. But if not a fracture, consult a physiotherapist.
Next Steps
Go to a physiotherapist.. Wax therapy +some strengthening exercises+some mobilization exercises will be helpful for sure.
Health Tips
At home.. Rest +hot water fomentation +pain killer gel +no long walking/standing +wear right size of shoes.