Dirac–Bergmann constraints in physics: Singular Lagrangians, Hamiltonian constraints and the second Noether theorem