In the absence of any injury, sudden pain in the great toe can occur because of inflammatory conditions, eg. gout (high
uric acid).
You can do ice application, drink lots of water and avoid a high protein diet.
I would suggest that you consult an Orthopaedic surgeon, who will prescribe medicines to reduce pain and inflammation, and get some blood tests done.