Help with implementing camera restraints

I found a solution to my camera restraints, however the post fails explain its processes in a matter I can understand. Could anyone help me with implementing their code?