A big toe that swells and aches overnight raises the treatment question before the cause is settled. This answer is anchored in Darien, Illinois, and the Downers Grove Township and Chicago metro area around it.
Diagnosis comes before treatment
Treatment follows the diagnosis, so the first job is working out which condition is behind the pain. NHS (Royal National Orthopaedic Hospital) says osteoarthritis, rheumatoid arthritis, infection or gout can all cause pain in the big toe and forefoot. If you want the condition itself laid out, read the Arthritis Foundation's page on treatments for gout.

Why the cause comes first
The Hospital for Special Surgery says the arthritis conditions that most commonly affect the foot include gout, rheumatoid arthritis and psoriatic arthritis. Gout shares that list with other forms of arthritis, so ask the clinician to name which one you have before treatment is discussed.
Nearby joint problems
Big-toe arthritis that is not gout has its own literature, including a PubMed Central review of hallux rigidus and its treatment algorithm. For surgery on the neighbouring ankle joint, there is Cleveland Clinic's page on ankle replacement surgery and recovery. Both cover other conditions, so read them as context and not as gout guidance.
What to plan next
Bring a record of when the pain started, which joint hurt, and whether it has happened before. A clinician can work from that list far faster than from a general description.
A careful note on upkeep
Ask what the plan covers in the months after the flare, not only the flare itself.