Camera follow the player

I am trying to make a camera follow the player game object. The player constantly moves along the X axis. The Y axis movement is controlled by the user input(simillar to flappy bird). I am making the camera to follow the player on X axis and not follow the Y axis movement. Is there any guiding materials to refer on how to implement a camera follow function?

There’s multiple topics on this already on the forum (search for camera lock). Here’s one discussion: Camera lock on x-axis? (SOLVED)