40 atoms isn't that much, so no need to save energy. You can use a hybrid like B3LYP and a triple zeta valence basis set like def2-TZVP. For the dispersion you can use a Grimme-type correction like D3 or the newer D4.
If you want to get your results faster, preoptimize the structure with something semiempirical like PM7.
This fully depends on your specific purpose, different kinds of task have different optimal combinations. For example, you may use B3LYP-D3(BJ)/6-311G** for geometry optimization, revTPSS/pcSseg-1 for NMR, wB97M-V/def2-TZVPP for single point, PBE0/aug-cc-pVTZ for polarizability, etc. Also, the answer is sensitive to the character of your system. For example, B3LYP-D3(BJ)/6-311G** is inexpensive and has a good accuracy for optimizing most organic systems, it is not suitable for optimizing [18]annulene, while in this case wB97XD is a much better choice.
B3LYP and PBE0 are decent for most organic molecules in the ground state.
Grimme dispersion corrections (D3, D4, D3BJ) aren't really necessary unless you definitely have long-range inter- or intramolecular interactions.
If you use ORCA it's convenient to use def2 basis sets, but if you use another software there are better choices.
6-31 basis sets are good enough for structure optimizations and vibrational frequencies, but not for energies.
6-311 basis sets are just a little better than 6-31. They allow to reduce the problem a little by using spherical harmonics. Plus, with a scaling factor one can calculate very accurate vibrational frequencies. def2 basis sets aren't accurate for vibrational frequencies even with a scaling factor, in my experience.
cc-pVXZ basis sets are quite good for any purpose, but I wouldn't use anything smaller than cc-pVTZ. If you use DFT you won't need anything bigger, though.