Just go to a doctor or clinic as you would for any medical problem, like cough, fever, or a sprained ankle; tell them what's wrong. Since you're concerned about STD, tell them that too, including whether you are at risk for STD (new partner, multiple partners, etc).
HHH, MD
So, do i just go to like a hospital and say i need to get tested?
I don't think you have an STD, more likely a bacterial or fungal infection. Perhaps more than one problem; the apparent infection at the base of the penis ight be different than the one on the thigh.
Definitely get examained, and if you have been at high risk for STD, perhaps a herpes test and other STD tests might be a good idea. But let your health care provider decide. (Don't be shy about telling about your sexual history; don't assume your health care provider will test for STD unless s/he thinks you are at high risk.)
Good luck-- HHH, MD