Here are some guidelines when using flour and cornstarch for thickening sauces.
Generally, for each cup of medium-thick sauce, use two tablespoons flour mixed with 1/4 cup cold water. Or use one tablespoon cornstarch mixed with one tablespoon cold water. Be sure to thoroughly mix the water with the starch (the flour or cornstarch) to prevent lumps. After stirring the combined starch and water into the liquid to be thickened, cook and stir over medium heat until thickened and bubbly. Cook and stir one minute more for flour and two minutes more for cornstarch to completely cook the starch.
Cornstarch is a great thickener. Whether it's heated with the liquid it's to thicken, or is added into a hot liquid, the general rule of thumb is to use 1 tablespoon of cornstarch for each cup of liquid. Here, to make custard, cornstarch and sugar are whisked together. Then, the milk is added. The mixture is cooked over medium heat, whisking to keep it smooth until thickened and bubbling. If the cornstarch were to be added into a hot liquid, for example a stir fry sauce, it would first be mixed with water, added to the hot liquid, and whisked until the proper consistency. It is properly thickened when it coats the back of a spoon.