How do I calculate fuel reserves for IFR and VFR flight plan?
For FAA regulations:

Once you've gotten everything planned and it's time to add on the fuel reserve, it is based on the airplane's fuel burn rate from a regulatory standpoint.

If the airplane burns ten gallons per hour, you can easily calculate that you need an extra five gallons, which is 30 minutes of flight duration at ten gallons per hour, for day VFR, and you would need 7.5 for night VFR under FAA regulations, which is 45 minutes of duration, so you would just add those to the total that you calculated that you would need to get to your destination, and you have successfully planned your reserve.

For IFR, you would have to select an alternate if the weather conditions require one, plan your flight to your destination, then to the alternate, and then add on 45 minutes worth of fuel after reaching the alternate, which would be 7.5 gallons after reaching the alternate airport.

This is the regulation for IFR reserve: 91.167