1. Hitting the golf ball straight
2. Adjusting your stance for the golf ball lie
3. Adjusting your shot for the golf course contour
I'll skip talking about how to hit the golf ball straight--that can be an endless discussion. But understanding the latter two, will help keep the ball heading toward the flag instead of an unexpected direction.
Beginner golfers often learn to position their ball at the driving range where they are standing level. When they go out on the course and they are standing on the side of the hill, they will position themselves the same way and the ball will go off in an odd direction.
When you are standing on the side of the hill, try standing on one or the other of your feet. You will soon see, that standing on one foot, will help to level you on a curved surface like these hills on the fourth hole at Black Bear Golf Club. You want to stand on the foot where the golf club will reach the ball, either forward or backward foot. You do this during your practice swing. When you follow through on your practice swing, check where your golf club is pointing--this is the direction your ball will travel. If it's not the direction you want to go, move the direction your forward shoulder points, so that the golf club points where you want to go when you practice. Now that you are sure that you can reach the ball, and that the direction is set to where you want to go, you can adjust your shot for the contour.
If you happen to be in one of these little scooped out areas shown on this photo of the fourteenth hole at Black Bear Golf Club, chances are you'll have to adjust your stance and then adjust your shot for the contour. By this I mean, how the golf club head sits on the turf. At the driving range, beginner's should learn to place their golf club as it sits naturally flat on the ground. On a golf course, where the turf is not level, the golf club head needs to be rotated in the hand until it fits level on the surface where the golf ball lies. If you don't do this, chances are when you swing, the golf club will slam into the turf and the golf ball will not go anywhere. Alternatively, the golf club will top the ball and the golf ball will smack down into the turf or bounce off.
By doing these two steps as part of your practice swing, chances are you will connect directly with the back of the golf ball, follow through in the direction you plan and hit a clean ball. There are general rules of thumb you can memorize for playing downhill and uphill lies, but its best to always test your stroke and the rules of thumb every time with a practice shot. You may see people out windmilling their golf club then missing the ball, that's because they are practicing with no plan for what they will accomplish. Doing these two steps should help you play the tough lies. Good luck.