either use this to pass directly with the Quaternion rotation when you call Instantiate, or use Instantiate first and then set the trasnsform of the arm
you can either
set it so the transform axis of the arm is aligned with your look direction with
transform.up = or transform.forward = or transform.right = , depending on which axis you need to have aligned. https://docs.unity3d.com/ScriptReference/Transform-forward.html
the problem is this overwrites the rotation while you only set a single axis direction
if you want to define both the forward and the up axis, you can try to use either of those
https://docs.unity3d.com/ScriptReference/Transform.LookAt.html
https://docs.unity3d.com/ScriptReference/Quaternion.LookRotation.html
the first forward argument should take precedence I think, if the up direction is not ideally aligned
say you have a desired up direction that should take precedence though, over the forward, you can make sure the forward direction is 90 degree aligned to the up:
Vector3 upAlignedForward = Vector3.ProjectOnPlane(desiredForwardDirection, desiredUpDirection);
Quaternion rotation = Quaternion.LookRotation(upAlignedForward, desiredUpDirection);
arm.transform.rotation = rotation;
if you want to ignore certain directions the player is facing, you can try to project a direction onto the ground, for example, if you are only interested in the y rotation
Vector3 globalYAxisRotationDirection = Vector3.ProjectOnPlane(defaultDirection, Vector3.up);