Mother nature designed the human being to walk barefoot over earth, mud, rocks, slime, dead things, things that are not dead, bugs, worms, miniature aliens on a short visit from the planet xenon, etc. Your paranoia about stepping on the sidewalk is nonsense on toast. I'm not going to humor you by saying you have legitimate fears. Psychiatrists prescribe drugs and I'm not sure that's what you need.
A person does not always get an infection from a skin puncture. A person's immune system is pretty powerful. In parts of the world people don't wear shoes. During the colonial period in America many people didn't wear shoes. Back then there was a lot of horse poop to step in (supposedly good luck).
I', not sure a psychiatrist is a good idea. You might try a psychologist who has behavioral experience.
you have to consult a psychiatrist, i think you may have ocd,because normally you wont think like that you have an infection just because of your foot being bare, no matter how much you rationalize your mind will escape to another possibility so please consult a psychiatrist