To hit the ball in the direction you intend, you have to set up aimed in that direction. What doesn’t get said is that you have to aim not only yourself, but your swing, too.
Just before you take the club away, imagine a short line on the ground in front of the ball going right toward your target. Tell yourself that is the line you want your club to be travelling on when it hits the ball.
Now you have aimed your swing. You have given your subconscious mind an order to swing the club along that line, and it will make sure your body complies.