How to attach camera to object

I checked the internet and this forum for recent codes but the replies are a few years back or for unity 5.x. I have put on hold some tutorials in the udemy website because I’m still new to the unity app. In the process of learning, I found some not very new tutorials within unity itself. I am currently in this link which can also be found in the youtube link. See below:

My issue is the codes for the camera controller is outdated so that it cannot focus like how the tutorial shows but goes extremely near the ball following the codes. However, when I disable by commenting the codes, the camera stays stuck where it is and just doesn’t move when the ball rolls round the board. Any help to complete this section of the tutorial would be appreciated. If you know the codes, or any link to useful tutorials, that would be really great so I can learn to code on my own.

Drag and drop the camera object onto your GameObject in the scene hierarchy view.

I tried that. The result is not what I expected : the entire screen rotates. I just want the camera to go nearer the object. See my screenshot.