How to make my side scroller character rotate different

So, I’m using the side scroller template to make a game but, i want to have it where when you press A, the character will turn the opposite direction, and the same thing for when i press D.

How do i do this?