A prominent class of osmolytes that are able to stabilize proteins in their native fold consist of small highly water-soluble molecules with a large dipole moment and hydrophobic groups attached to the positively charged end of the molecule, for which we coin the term dipolar/hydrophobic osmolytes. For TMAO, which is a prime member of this class, we perform large-scale water-explicit MD simulations and determine the bulk solution activity coefficient as well as the affinity to a stretched polyglycine chain for varying TMAO dipolar strength and hydrophobicity. Double optimization with respect to experimental values for the activity coefficient and the polyglycine transfer free energy is achieved. The resulting optimal TMAO force field shows excellent transferability to different concentrations and also reproduces transfer free energies of various amino acids, including the tryptophan anomaly, for which TMAO acts as a denaturant. By globally analyzing the thermodynamic and structural properties of suboptimal TMAO force fields, we identify the frustration between dipolar and hydrophobic interactions as the working mechanism and the design principle of dipolar/hydrophobic osmolytes.