Sounds like it could be three things. Could be fordyce, HPV (genital warts) or HSV (genital herpes.) Fordyce isn't a std or infection. Just natural bumps, but can be removed with cosmetic surgery. The other two are treatable as well, but could show a breakout every now and then. Hope you have gotten your answer by now.
How do I remove it from my head
That’s completely false. I had blackheads on my shaft, long before I ever masturbated. I squeezed them out, and haven’t had any show up in years.