Constraint Formalism of Classical Mechanics