pimple like bump

a couple of days ago i got this on my shaft, it didn’t hurt at all not even to the touch (before i popped it), it felt kind of hard, almost like a little ball or circle thing was inside it, and it had a white tip. I popped it, thinking it was a pimple or something. However, after the puss came out (just like a pimple) i could still feel that “little circle or ball” inside. It now looks like this, after having popped it. kind of sore to the touch, like a pimple when you mess with it too much.
any ideas if it’s a cyst, or STD or just an ingrown hair or pimple? it was by self, no other sores or pimples, still is alone, however after popping bump and little ball thing still there.

Just want to add that i masturbate sometimes by rubbing on things, could it be like a friction thing from the elastic on the underwear?

please help

The white pus means there is an infection - you need to treat this and see whether it reduces in size, or even completely heals
Use liquid antiseptic - check the instructions on how to use - I would suggest applying the solution 4 or 5 times for the first 2 or 3 days. If it begins to reduce in size continue using the solution for a further 3 days or so.
It may be a blockage of some sort, or you may have a cyst AND the blockage together. It could also be an ingrown hair - you need to clear the infection then see what you have …