How to make a Prefabs child object rotate?

I have made a endless runner where the pick up is either toggle on or off on the tile depending on a 1 in 10 chance. I’ve tried through attaching a script directly to the object and then giving a transform rotate but it doesn’t work.

any code or help will be greatly appritiated.

GameObject go = Instantiate(prefab,new Vector3(),new Quaternion());

// if the child you want to rotate is named pickup pickup has to be a child of the prefab

go.transform.Find("pickup").transform.rotation = rotationVector;