It is better when using flour to use it in the form of a roux, which is a cooked mixture of fat and flour. Depending on how long the roux cooks, it takes on more or less coloration and is called a white, golden, or brown roux.
Making a roux has a purpose. If you taste a bit of raw flour, you will notice how sour, almost bitter, your palate becomes. The precooking of the flour in fat removes that unpleasant taste, replacing it with a pleasant toasted flavor; also it initiates the swelling of the starch granules in fats such as butter which contains 20 percent water. It also deactivates the many enzymes present in the flour, which might hydrolyze the starch when the liquid is added, thinning the sauce.