I need help making camera rotations with inputs

It did work thank you!!! But I have a question, If I press the input keys too fast it messes up the direction I want the camera facing. It also lets me turn fully around but, I just want it to turn three directions, forward to my left and right. How do I do this?