Could be a boil. It is an infected hair like a pimple, but it is deeper and hurts very badly. Look it up and you can figure out if that is what you had.
The symptoms of boils
are red, pus-filled lumps that are tender, warm, and/or painful. A yellow or white point at the center of the lump can be seen when the boil is ready to drain or discharge pus.