A boil (or furuncle) is a type of skin infection in which bacteria get into the base of the hair shaft and set up an infection. Often this causes redness, swelling, and a collection of pus under the skin. Many boils can be treated conservatively, meaning you can just apply warm compresses and take some over the counter pain or anti inflammatory medications.
However, sometimes the amount of pus that builds up inside the boil is so much that the area must be opened up by a doctor
to allow the pus to drain and the boil to heal. Similarly, sometimes the infection begins to spread into the skin surrounding the boil (this is called cellulitis). Based on the fact that you say the area is very swollen and quite painful, I think it is best for you to see a doctor to make sure neither of these two things are going on.
If you have severe pain, fever
, or if there is a large area of redness spreading around the boil you should not wait to see your doctor but should instead go to the emergency room for evaluation.
After seeing a doctor, they may decide to drain the area and they may prescribed oral antibiotics.