Feed the fish as much as it can eat in a couple of minutes. However, do not just put food in and wander off for 2 minutes. Get 1 flake and crumble it up a bit so the fish can eat the little bits. Small fish like guppies cannot eat a full flake unless it is crumbled up.
The fish should eat all the food within 20-30seconds. Then you can crumble up a bit more for it. Continue doing this until the fish no longer races up and chomps down the food really fast. Then stop feeding and remove any uneaten food.
It takes practice and you will learn how much to offer.
The fish should also get other types of food. Live brineshrimp, daphnia and bloodworms can all be used to supplement the flake food diet, and will be appreciated by the fish.