What would be the clue to learning to use this and when to use what ??
As in this photo, I really wanted everything sharp, but decided just to have the city below
in focus, the woods infront more out of. Didnt bring any tripod, as usual, so I had to handheld this one:
You need to learn more about how focal length and aperture combine to produce depth of field, otherwise known as
Hyperfocal Distance. You're using a 20mm lens at f5.6, which yields a remarkable amount of depth of field, believe it or not. Say the town is far enough away that your lens focused on Infinity. For that focal length and aperture anything from about 13 feet to infinity would be in focus, and anything less than that would likely not be very out of focus. Even wide open at f4 you'd get everything from 18 feet on. A wide angle lens like that is more effective producing bokeh on objects in the distance than those close up. With the same settings if you had focused on something only 4 feet away you would have started losing focus at about 5 1/2 feet and the town and mountains would have been a blur.
The wider the focal length the more quickly you hit hyperfocal distances that capture infinity even at wide apertures. There's an app called TrueDoF-Intro that's free for iPhone users (I'm assuming there's something similar for android) and it will help you determine hyperfocal distance and depth of field. It's handy as heck for figuring this stuff out and easier than doing the math yourself. I've been spending lots of time with it testing the focus on my 150-600mm and determining just how wide my DoF is at 600mm shooting something at various distances (for a squirrel 40 feet away it's about 3 inches with a DX camera).
In other words, it's not the focus system that's at fault here, it's the math.