Help with Side-to-Side Movement

As the title suggests, I need help getting the player to move to the other side of a screen on mouse click/touch. I know how to make the condition, but I don’t know how to produce the event. I want the player to be in a fixed position at the bottom of the screen, and when it’s pressed/clicked, the player can move side to side to avoid obstacles.