how do you keep the camera not go out of bound on a 2D sidescroller?

me and my group are making a 2d game similar to gala but horizontal but when my programmer put the camera to always follow the character it goes out of bound of the level if the character goes too low or too high.
can someone help me?