If you just want the character to face left or right based on which side of the character the mouse cursor is on, that's pretty simple. Here's one example:
$Sprite.flip_v = get_global_mouse_position().x < $Sprite.position.x
In this case, I'm just setting a sprite's flip_v propery to either true or false based on whether the mouse cursor is on the left or right of the sprite.
Note, the above code assumes the sprite faces right by default...