Toggle camera on a object?

i want to let my cam always face on my object,i ve see ppl use this function, but i dont know how they did it,

thanks

Add the camera a Track To constraint and write in the Ob: field the name of the object you want your camera to face.

Add a Track To constraint.

Select camera.
Under the Object buttons, on the Contraints panel, add a Track To constraint.
Enter the name of your target object in Target, and set To to -Z and Up to Y.

Done.

EDIT: beaten.

Right click on the camera and while holding shift right click on the object…then press CTRL+T. Then select track to contraight.

thanks easy and clear!!