How to make an object do something different the second time that you click it.

How do I make an object do something different the second time I click it?

This is an example of a pause button. If you click on it, the game pauses. And if you click again. You continue the game.
pause button

thanks!