This is a simple conditional statement example using an "if then" statement. Look inside to see how I've coded this simple animation.
You can check out my video tutorial for Conditional Statements on the official Scratch YouTube channel (look for the Conditional Statements video series) and find a link to written resources related to this topic in the video description.