How to rotate object based on direction

Hi,

I want to rotate an object based on a direction my character is pushing (X or Y), I can get the direction the player is pushing, and for example I want to rotate by 90.0f on the direction I am pushing.

I am bad with rotation stuff