Hello and welcome to e health forum.
Most probably you may have developed a infection of the subcutaneous tissues of the toe, which is sometimes occurring with ingrown toenails.
Such infections may need proper evaluation and treatment with prescription medications.
Other conditions that can present with such pain and swelling of the toe, include gout, pseudogout, osteomyelitis, etc.
Hence you may consult with a doctor for a examination, proper evaluation and treatment.