If you are making a meal with a lot of ingredients that require washing, peeling, and chopping, chances are you should set up a mise en place. Organising all of your ingredients in neat little piles (or ramekins) means you can follow the recipe at the pace required, without having to pause to fiddle. The order you prepare your mise in doesn’t matter that much, with one caveat: you should absolutely prep your onions last.
As we all know, onions are full of pain. Once you rupture their cellular walls, they retaliate by releasing enzymes, which rearrange themselves into various compounds, including syn-Propanethial-S-oxide, the compound that makes you cry. (It is, for all intents and purposes, a tear gas.)
Obviously, you want to hang out with this dude for as little time as possible, so chopping onions (or worse, shallots) should come dead last in your prep, so you don’t have to weep your way through — or wear dorky glasses during — the process of chopping carrots, root vegetables, herbs, and whatever else is going into your recipe.
The one exception to this is when know you need to caramelise those onions before you can proceed with the recipe. Caramelising, as we all know, takes longer that you expect it to, so chop the onions, and get them in pan to start that whole process, then finish the rest of your mise.