If you want the camera to follow the player smoothly, the most common way to do this is with lerp:
Camera set x to lerp(self.x, player.x, dt)
If you want to move the camera only when needed (for example, when player walks into another room), the easiest solution would be using MoveTo behavior.