How to make a character only moves in one way?

Hello! Im wounder how to get my character move in one/two ways i want him to move left and right. I am making a 2D game (A little of me trying thing) I wont check youtube again.
So i really need help. I am gonna try one more thing, BUT…, Write any way i really need help!!! from me!!!

Try this, you might have to edit it to get to the way you want it, but here,