If you're out and don't have any of these remedies (or don't want stuff in your hair), just wet your hands a bit and rub them together - then smooth your hair with your damp hands - static gone!
If you spray some hairspray onto a tissue, and then run over the flyaway hairs, this should calm them. Only use a tissue, because if you use your hands, it will make your hair greasy.
Use a small amount of hair gel to smooth away flyaway hair rather than serum as it causes the hair to look greasy and doesn't hold for as long. Spray with hairspray after to keep it in for a night out!
Purchase a can of Static Guard (used on clothing) spray the hair brush or comb with a swish of it and a swish of a light silicone spray (no denat. alcohol in formula) (RUSK makes a good one), then brush/comb thru the affected areas.
Layer until its done its job usually takes only once or twice.
Smooth your hair the whole length with one of those fabric conditioner sheets which are designed for use in Tumble Dryers. they work, they don't leave hair lank or greasy looking, smells nice too.
Hair usually becomes static in the winter when you have central heating on. Put a bowl of water over the radiator in your room so moisture gets into the air. this should stop your hair from becoming flyaway.