How would I remove rotation on the Z Axis from the torso's CFrame?

I need to remove rotation so that the player can be completely upright before I changed it

You can be tilted even if the Z axis is 0:

workspace.Part.CFrame = CFrame.Angles(1, 1, 0)

What are you actually trying to do at a high level?