The Secret Is The Pre-Shot Routine!
The purpose of a pre-shot routine is to provide a deep focus on what you want to happen to each shot; rather than what you don't want to happen. It productively distracts your mind from negative thoughts or visualizations, while helping you stay aware of elements that affect your shot like wind, slope, lie, and distance.
Say to yourself: "The hole is 130 yards away with wind left to the right. Let's start the ball at the tree behind the left side of the green with a smooth swing" rather than "Don't slice this shot out of bounds again. This hole always gets me. I don't want to look silly in front of my friends. Hopefully I don't go left into that deep bunker. Here goes nothing..."
The whole routine lasts only 15-20 seconds, but needs to be distraction free for every shot you play on the course.
Step 1) Analyze
What elements are affecting your shot? Wind, slope, lie, elevation, yardage, safe zone, starting line, how you're hitting it that day, location of hazards and obstacles. Analyzing this info helps you choose a specific target and a club to get it there. Good shots don't just happen: you have to analyze and prepare for them.
Step 2) Visualize
The more vivid you can imagine the shot before you hit it, the better. Play a movie in your mind of how high and far the ball will go, and how it will roll once it hits the ground. This is especially key for short shots around the green.
Step 3) Commit
Once you've picked your target and club you need to walk into the shot with confidence, make a practice swing to get a feel, and pull the trigger. DO NOT freeze over the golf ball and fill your mind with thoughts. See It, Feel It, Trust It.
Also, if you get distracted its important to step back and start your routine again. No more hitting uncommitted shots.
Step 4) Assess
Ask yourself how well you executed steps 1-3, regardless of the result of the shot. If you did well, pat yourself on the back because you gave that shot your best effort. That's all you can ask for on the course. Don't waste shots because you're unfocused, distracted, rushed or uncommitted.
Remember: If you focus on the process, positive results are much more likely to happen. You cannot control the outcome, only the process.