This sounds a lot like a sebaceous cyst. This is a type of growth under the skin in which thick cheesy material collects in the cyst. Occasionally, this can become inflamed and infected and can grow rapidly in size until it ruptures and leaks out blood and pus like you describe.
Simple sebaceous cysts that do not regularly do this are of no concern and do not need treatment. However, once you have had several episodes of this problem, it is best to have them taken care of. If the area is still red and inflammed, you may need to wait for it to calm down first, or you may need to take antibiotics to clear up any infection.
Once this is done, you can have the cyst removed surgically. This is actually a very simple surgical procedure and it can usually be performed by your doctor
in their office with just a small amount of numbing medicine injected under the skin. After removal of the cyst you will have a few stitches put in place until the skin heals over. Once healed, the problem should be solved and you should not have any recurrences of the swelling in this location.