HOW TO MAKE MIREPOIX
Mirepoix is simply a blend of aromatic vegetables that are supposed to provide a supporting flavor to the dish. The combination of ingredients is not written in stone, so even though the basic formula means 2 parts onion, 1 part celery, 1 part carrot - you can change it and adjust it as you wish, all after the kind of dish you are preparing. Besides the above mentioned vegetables, you can also use: leeks, celery, celeriac, parsnips, peppers, tomatoes, or garlic. For more "advanced" formulas with more unorthodox flavors you can try mushrooms, green onions, or ginger. Anything that will add the right flavor to the dish is acceptable. Also, a tomato paste can be added to provide additional taste and some acidity.
The usual amounts used to flavor the dishes are 1 part mirepoix to 8-10 parts of rest of the dish. Mirepoix is so flavorful that you don't need to add much of it to spice up the dish.
How does one make a mirepoix? First, prepare the vegetables: rinse them from all possible dirt, peel the skins, and then start to chop them into smaller blocks. The more fine-chopped vegetables are, the quicker they will release their flavors. Bear in mind that the sizes of the vegetables should be fairly similar, since you already should have designed the relative proportions of each ingredient in the mirepoix. So, the proportions should determine the final flavor of the mirepoix, and not randomly chopped vegetables. You should also adapt the size of the vegetables to the kind of dish you are making. So, for example if you have a stew that is simmering for a few hours then your mirepoix cuts can be bigger. If you have marinades to work with, make smaller dices of the vegetables.
Common combinations of ingredients for a basic mirepoix were mentioned above. If you want to have a white mirepoix, you can instead combine 2 parts onion, 1 part celeriac, and 1 part of parsnips. For more exotic mirepoix, try 2 parts ginger, 1 part garlic, and 1 part green onion, maybe even with some mushrooms. The possibilities are endless.
To cook the mirepoix, put some oil in a moderately hot pot, and add the onions or leeks. Let them sweat for a little while, then add the carrots, and lastly, after a few more minutes, add the celery. This sequence is important from the required time of cooking point of view. Remember not to overheat the veggies or they'll get brown. The point here is just to sweat them - this is when they release their juices into the oil. You can also smother the mirepoix if you want, even in an oven (smothering means simply that you put a lid on top of the pot, so the veggies get sweated and steamed at the same time). As you can see, this basic mirepoix is actually a basis for lots of recipes - how often haven't you sweated onions and other vegetables before blending in other, main ingredients? Mirepoix can also be used in other situations, that is added directly to a simmering stew, just to give an example.
Now, once the veggies are softened and sweated, you can add (optional) the tomato paste and cook the mirepoix until it becomes caramelized (browned) and the tomato paste becomes stiffer. Then, use the mirepoix in whatever way the dish requires.