Good suggestion from Slobodan, but you need to choose the circle of confusion according to your viewing distance and print size. The 0.03 mm is an old standard based on smallish print viewed at 25 cm. A large print viewed at short distance will be most demanding.
I agree with Erik, the COC diameter used in that web tool is much (approx. 3x) too large for critical work where larger output may be required. Personally I prefer a tool like VWDOF
(a Windows only application), which allows to set one's own COC criterion, and output a number of different scenarios. It also allows simple text output which is easy to use in a spreadsheet or on a smartphone. That's what these DOF tools are most useful for, scenario testing before being confronted with a siuation in the field.
Diffraction can be compensated with proper sharpening, at least to some extent.
That's correct, but how well that works also depends on microdetail contrast (and thus subject matter). It also helps to shoot at low ISO settings to reduce the noise, which will interfere with restoration sharpening. Low contrast detail will already get lost at apertures like f/5.6 - f/7.1 (for sensors with a 4.88 - 6.4 micron sensel pitch), and all microdetail (even high contrast) will be lost at f/22 on most sensors. And when I say lost, I mean without any possibility for recovery, lost. Depending on the lens quality and sensor, f/16 or f/18 are at the limit of being able to resolve fine branches against a bright sky, but lower contrast detail on the ground (soil/sand/twigs, grasses, leaf detail) will be compromised.
So the recommendation is to use an aperture as wide as possible, and as narrow as needed. As for what is needed, there is also a possibility to use focus stacking which requires multiple exposures at different focus distances, and not too much motion (branches swaying in the wind may cause 'ghosting' problems).