I will confess that I tend to avoid thinking too much!
But still, there are things to consider -- photography can be a "juggling act"!
I would tend to avoid the scenario of trying to get close things as well as further things in good focus...as was suggested, move yourself to get better results!
One time, though, back in the summer of '08, I was at a POTN meetup in the Columbia River Gorge (East of Portland, OR). We were at a spot looking up a stream with some falls in the background, but the stream flowed down to us, around some rocks in the foreground. I wanted to get the "whole shot", although I was in a "fixed" position -- I knew that with a "normal" f/16 aperture; well, I'd be limited...
So, J went the limit, set the dang lens to f/22 and took the dang shot.
Actually, I was happy with the outcome, it was worth sharing, in fact a POTN friend said "Print it!" and I would have, except that zoomed in, it showed a patch of greenery was blurred, I guess from a breeze, Oh Well!