The most basic implementation would look something like this:
You can see them getting stuck if blocked by something else, you did not include any details so not sure if this is a desired behaviour for you case.
You can, of course, implement this in the character and have it push objects away from itself instead.
For a physics based approach, it’d be enough to give them an impulse in the appropriate direction, much simpler solution.