Camera follow 2D sprite when it goes off screen

I just want help making a simple script that will make the camera follow my sprite when its position is farther then the screen size just like any 2D tile engine game has. I don’t want a script written for me I just want an explanation of how I could do it. Of course I just want it to follow on the x and y axis.

if you would like the camera stick on the target, why don’t you just put the camera as a child of the target ?