How to rotate a cube in unity?

I’ve been trying to work out how to do this for an hour now.
What I’m trying to do is when a person picks up an object (I’ll call it the cube for now) then the cube should rotate to 0, 0, 0 on the local axis.

I have this right now and it’s not working.
transform.localEulerAngles = new Vector3(0, 0, 0);
And I tried going on multiple documentation, forums, and tutorials. Can anyone help me with this?
(By the way, does the cube getting parented to an empty game object have anything to do with this?)

The line:

transform.localEulerAngles = new Vector3(0, 0, 0);

Will certainly rotate the object to local euler angles rotation of 0, 0, 0. Keep in mind that local rotation means it’s local to it’s parent. So by setting the localEulerAngles to zero the child will have the same rotation as the parent.

Your initial condition was that you want to rotate it’s local rotation to 0,0,0. That’s exactly what happens. If that’s not what you want, then your initial condition is already wrong.