There’s basically three ‘modes’; sattvic (goodness), rajas (passion), and tamas (ignorance). This relates not just to food but also activities and even the colours one wears or surrounds one’s self with. As my link shows onions and garlic are classified as rajas and tamas.
To only eat sattvic food and do only sattvic things would be quite a challenge though, outside of a monastery life. Many healthy foods are also rajas. For instance.. olives and avocados are considered rajas, and food left overs are tamas. In both cases I don’t consider it very practical to eliminate them. I don’t know if one can be pure sattvic in everything. Having said that, it’s definitely interesting to experiment and some things rajas and plenty things tamas are a hindrance to spiritual practice. Something as “innocent” as coffee or something like alcohol has impact. With food you can observe a lot too. Garlic, and onions less so, are stimulating foods..