That's a pretty broad question, and the answer hinges entirely on which engine and programming language you're using. That said, the core idea is simple: you clear an image off the screen and draw a fresh one in its place, say, whenever the left-arrow key is pressed.
Without knowing your specific setup, I can't get too precise, but the general technique is to keep erasing the old image and redrawing a new one. Do that quickly enough, and you create the illusion of a sprite that's changing or moving.