Moving a Character Based on Rotation [renamed]

I’ve been trying to figure this out: Say you have your character MC and you move him forward and backward with the arrow keys. By pressing left and right you rotate your MC left and right but as the MC is rotated Up and Down now move him forward and backward depending on the direction the MC is facing, like a car except not really. If possible: could you give an elaborate description on how the code works. If not, then I can just mess around with it.