Follow x rotation of a target object.

I need a C# script that makes a transform follow the X rotation of a target object, I am very new to Unity, sorry if this is a very nooby question!

I did try to make on my own, but I am getting so much compiler errors all the time, but I will learn through examples.

Thank you!

check this