A GM should always convey a clear picture of the stakes and consequences of the PCs' actions or inaction. What horrible things will happen if the PCs fail? What can they achieve if they go beyond what's expected of them? A well-constructed adventure conveys the stakes at the outset, but it's also important to remind the players of those stakes throughout play. A game where the stakes are extremely high all the time cuts out the opportunity for low-key scenes, and can be overwhelming or even monotonous. In most games, players enjoy having some scenes where their characters can relax and socialize with low stakes as well.
Consequences should be specific and evocative. Don't just tell the players what happened after success or failure; let their characters witness it in the game universe. Are they treated as celebrities or pariahs? Does the reactor deep within the derelict ship stutter and ignite, exploding as the PCs escape? Does a failure lead to the death of an ally and a somber funeral? It's usually best if the PCs can foresee the consequences, at least in a general sense. If a villain demonstrates their intention to attack a planet, and the PCs don't stop them, then the planet is invaded by imperial troopers or hired guns. It's okay if you have an idea for an interesting subversion occasionally, but keep those to a minimum or the chain of cause and effect will become too muddy.
Unexpected failure can bring the game to a halt, particularly during exploration. “Failing forward” means finding a way to progress the story instead of saying, “That didn't work.” This doesn't mean the group can't fail, or that the PCs should get what they wanted despite failing. Rather, it means that a failure might still impart more information, reveal a way to improve their chances next time, or even cause unforeseen difficulties. Doing so means the player's choice to attempt a check mattered, even if the results weren't what they wanted. Allowing the PCs to fail forward means fewer dead ends and perfunctory checks. It's important, however, not to put unnecessary pressure on yourself to do so all the time. Sometimes you won't know immediately how a PC can fail forward, and in those cases, it's usually best to just move on.