Cosmological perturbation theory is currently a preferred mathematical procedure to compare the equations of gravity with precise observations in the context of early inflationary Universe. However, due to the difficulties in interpreting gauge-invariance and invertibility in Hamiltonian formalism, there is no consistent and generalized Hamiltonian analysis for cosmological perturbation theory at any order for any kind of model of gravity. In this work, using a simple model, we provide a simple mathematical approach to deal with all the difficulties to obtain a consistent Hamiltonian formalism and extend the approach to canonical scalar field. We show that our approach can be applied to any order of perturbation for any fields including Galileon and generalized non-canonical scalar field model. We compare and contrast our approach to the Lagrangian approach (Chen et al [2006]) for extracting higher order correlations and show that our approach is quick and robust and can be applied to any model of gravity and matter fields without invoking any approximations including slow-roll.​