There are a couple of different possibilities here, and I strongly recommend that you go to see your primary care doctor
, who can examine the bump and help figure out whether this is something that needs treatment.
The concern about a sexually transmitted infection is worth ruling out. Usually sexually transmitted infections like syphilis will cause an ulcered area in the genitals, which it doesn't sound like you have. Nevertheless, your doctor can perform some basic tests to rule out common sexually transmitted infections. Make sure to mention to your doctor if you have any other concerning symptoms, like pain with urination or discharge from the tip of the penis, as these would also be consistent with a sexually transmitted infection.
Another possibility is that this is a minor skin infection called folliculitis, which occurs when the base of a hair shaft becomes infected. Similarly, an ingrown hair can present as a small red skin bump. Usually folliculitis or an ingrown hair can be treated with good skin hygiene, but sometimes antibiotics prescribed by your doctor will be needed to help clear up the infection.
Contact your primary care doctor and make an appointment to be seen at your earliest convenience.