Rotate Object to Parallel (or Vertical) to other Axis

Dear all

If I want to Rotate object to parallel (vertical) to other aixs or other dimension (xy dimension or… xy dimension…) as Following Image Example…

Is there any command or function can I to use… ? thank you