This is my recipe for vegetable stock. I've tried different methods and this works the best for me.
1. Preparation.
As you are going about your regular cooking and eating schedule, instead of throwing various bits of vegetables away, stick them in a ziploc bag or container of some kind. This is the stuff that you cut off of the vegetables with the intention of not using them--the ends of celery and carrots, the stalks of fennel, the leaves and tails of beets, potato skins, leek greens, mushroom stems, onion skin, garlic skin, tops of tomatoes, pulp from making juice, and so forth. Do it with fruit too--like orange peels, the outside of the pineapple, apple cores, whatever. I even put in used teabags. Stick all that stuff into a container and freeze it.
This is not to say that you can use everything that you don't eat. Check if ingredients are potentially poisonous, like rhubarb leaves. Use your best judgment.
It doesn't have to be only vegetables. Use bones and trimmings from meat to get more body and flavor.
You can also reserve the water used to boil/steam vegetables, which would normally be drained and dumped, to use as a base instead of using fresh water.
2. Making the stock.
When you've decided to make the stock, pull out the container of scraps. Put the veg scraps in a pot. Then fill it up with water. Put the pot over high heat. Add oil or seasoning if desired.
When the water starts boiling, turn the heat to low. Let it simmer for a while, at least 10 minutes.
The longer you let it simmer, the darker and more flavorful the stock will be. I tend to wait until the vegetables are mushy--but it's OK to simmer it for less time.
When you've decided it's done, turn off the heat and let the pot sit until it's cool enough to handle.
Use a colander over a large bowl to strain the stock. Throw away the vegetable scraps. Pour the stock into jars and store in the fridge. Freeze into ice cubes for more longevity.
3. Using the stock.
Use the stock as a base for soups and gravies, and for cooking rice or other grains. Use as the liquid for essentially any savory recipe.