Swelling and pain along the nail border, sometimes with drainage, indicates an ingrown toenail.
If your ingrown nail is infected, you'll likely need antibiotics, and possibly a nail procedure. While waiting to see your doctor, soak the toe 10 min/day in luke warm water and epsom salts, use a small amount of topical antibiotic
ointment, and cover with a bandaid. Don't go after it yourself!