For getting a small depth of field, you would use an aperture of f/3.5. For a landscape, you want the foreground and also the background is focus so you would use a number like f/9 or f/11. Those numbers are usually the sweet spot of zoom lenses, where they reach peak sharpness.
I read a source that explains that going beyond f/13 on cropped-sensor lenses (or beyond f/16 on full-frame lenses), the loss of overall images sharpness deteriorates (diffraction blur) and thus is probably not worth the greater depth of field gained. You can have virtually everything in your photo sharp at f/22, but throughout the image there will be a lack of sharpness (especially zoomed to 100%).
Example photos on a website: Diffraction with Small Apertures