GetComponent Rigidbody

I have a simple question, in C# how do you freeze/unfreeze the rotation of the axes x,y,z in the code?

I tried using
GetComponent() freezeRotation

What else do I need?

Try this:

Thanks

You can also do this in Unity itself, just click the freeze rotation button.
Unless of course you want it in code.