Golfers distracted by players in their peripheral vision, a car alarm going off in the distance or someone casting a shadow over their ball are worried about hitting a bad shot instead of focusing on the target and their pre-shot routine.
Distractions are part of the game. Golfers who accept this and view them as a challenge aren't as bothered by them. One way to become mentally tougher is to expose yourself to distractions so they don't bother you. Ask your friends to talk, rattle pocket change and move around while you putt or hit shots. Soon you won't even know they're there.