Walk home one step at a time
Haskell, 21 bytes



(!!).([(&lt;0),(&gt;0)]&lt;*&gt;)


Try it online!

Outputs a boolean with True being move forward and False being turn right.

Haskell, 28 bytes

Here's a version that is easy to understand / translate into any language.



f(x,y)d=[x&lt;0,y&lt;0,x&gt;0,y&gt;0]!!d


Try it online!

Explanation

The idea here is two-fold


We notice that we only ever need to turn in one direction.  A turn left is just 3 turns right.  So we will limit ourselves to only right turns.
Now we notice that given a direction there is a simple condition that can check if we ought to move forward.  Namely the sign of one of the two variables.


With this information we construct out solution, by making a list of the conditions and indexing the list with the direction.  True means the condition was passed and we can move forward (so we do), False means the condition was failed and we should not move forward, so we rotate.

Now the specification allows us to just output these values as is, since they are distinct and we have no intention of turning left.