How do i add a layer to a gameobject?

I am trying to make a gameobject be on the Ignore Raycast layer using code. How do i do this?

gameObject.layer = LayerMask.NameToLayer(“IgnoreRaycast”);