You’re in good company: This question also stumped the physicists who first tried to understand nuclear fusion in stars.
In a star’s core, all atomic nuclei have been separated from their electrons, so each hydrogen atom is really just a proton and thus holds a positive charge. The positive charges repel, and without some external force pushing on those protons, they will not get close enough to join.
Astronomy magazine subscribers can read the full answer for free. Just make sure you're registered with the website.