Rest is a general good treatment for foot pain. Your doctor might have you wear a brace, boot, or splint and/or use a walker or crutches and avoid putting weight on your foot so it can heal.
Wearing comfortable, supportive shoes with enough space for your toes may help keep foot pain from getting worse.
Depending on the cause of your pain, you may also have inserts to wear in your shoes or on your feet. For example, you may wear little foam bandages for foot corns and calluses.
If you have broken bones, Charcot foot from diabetes, or several other conditions, surgery may be needed so you can use your foot again.
After surgery you will have restrictions on using your foot while it heals, and will probably attend physical therapy.