A sustainable diet is, by definition, nutritionally adequate, economically affordable, culturally acceptable, and environmentally respectful. Designing such a diet has to integrate different dimensions of diet sustainability that may not be compatible with each other. Among multicriteria assessment methods, diet optimization is a whole-diet approach that simultaneously combines several metrics for dimensions of diet sustainability. This narrative review based on 67 published studies shows how mathematical diet optimization can help with understanding the relations between the different dimensions of diet sustainability and how it can be properly used to identify sustainable diets. Diet optimization aims to find the optimal combination of foods for a population, a subpopulation, or an individual that fulfills a set of constraints while minimizing or maximizing an objective function. In the studies reviewed, diet optimization was used to examine the links between dimensions of diet sustainability, identify the minimum cost or environmental impact of a nutritionally adequate diet, or identify food combinations able to combine ≥2 sustainability dimensions. If some constraints prove difficult to fulfill, this signals an incompatibility between nutrient recommendations, over-monotonous food-consumption patterns, an inadequate supply of nutrient-rich foods, or an incompatibility with other dimensions. If diet optimization proves successful, it can serve to design nutritionally adequate, culturally acceptable, economically affordable, and environmentally friendly diets. Diet optimization results can help define dietary recommendations, tackle food security issues, and promote sustainable dietary patterns. This review emphasizes the importance of carefully choosing the model parameters (variables, objective function, constraints) and input data and the need for appropriate expertise to correctly interpret and communicate the results. Future research should make improvements in the choice of metrics used to assess each aspect of a sustainable diet, especially the cultural dimension, to improve the practicability of the results.