Theoretical Modelling of Gas Cooling and Feedback in Galaxy Formation