I designed a dungeon once where the players had to bypass an army of skeleton pirates. Stealth was encouraged, but not mandated, because you can never force your players to do what you want them to do.
Instead, what I prefer to do is offer a lot of options to my players. This means including branching paths in the dungeon, and making stealth the easiest approach for them. For this to work there should be an initial opportunity for the players to get a glimpse of what they're up against, without immediately getting caught. So the first encounter with the guards requires no check, the players can simply see the guards from a safe position, without being spotted. This allows the players to get an idea what the positions of the guards are, how to stay out of sight, what their patrol routes are, and form a plan.
Patrols
I try to make guard patrols very simple and easy to understand. While a real guard would not be this predictable, I tend to wave realism away in favor of gameplay. I treat this like a computer game, by having every guard behave predictably and simple. Some guards may stay in one place constantly, and merely face different directions every now and then. While other guards simply move from A to B and back again. This allows the players to clearly state an approach, such as: "I wait till the guard on the tower is looking away from us", or "I wait till the guard walks towards us, and then grab him as he turns around".
Cover spots
You'll want to include plenty of cover for the players, so they have things to hide behind. And they should be able to take out some of the guards without being spotted by the rest. The players may want to wait for one guard to be alone, and then quickly drag him behind cover to quietly take him out.
Height differences
I also tend to include lots of height differences, because this provides more ways for the players to stay out of the line of sight of guards. For example, a guard on a bridge will probably not notice a player swimming underneath it, or swimming entirely underwater. Where as a guard on a balcony will be able to see very far, but will have a blindspot underneath the balcony it is standing on.
Not too many checks
The more rolls the players need to make, the higher the chance their stealth fails, despite their best efforts. Unlucky rolls are always lurking, so try not to force too many rolls on your players if you want them to consider stealth a valid option. Because statistically, they are eventually going to make a bad roll. For example, if a player has to cross an area without being noticed by guards, that should require just one stealth check, even if there are multiple guards. You could even decide that only one party member makes all the stealth checks, and he then helps the other players cross unnoticed. This simplifies the stealth a lot, and makes the stealth not hinge on the weakest link of the party.
Failure conditions
But as a DM you need to have a plan regarding what happens when the stealth fails. Is the entire dungeon alerted? Or is only a small section alerted? Can the players perhaps intercept a guard who runs for an alarm bell? I tend to be rather lenient in this regard, because the players aren't perfect. They make mistakes, and they can have an unlucky roll.
Most importantly: One failed stealth check should not immediately alert all the guards, it may just draw their attention to a suspicious noise, leading to an exciting challenge where the players must hide from sight, kill the guard quietly or distract the guard. As long as the guards are unaware of the presence of the players, one strange sound is no reason to sound the alarm... yet. Use this as an opportunity to build suspense, rather than punish the players for making a bad roll.
Drunk, stupid and talking guards
These are best to teach your players how to use stealth, so use them early. Drunk/stupid guards are easy to bypass and easy to fool. They don't pay a lot of attention and can add a bit of humor to your stealth challenge. I also like to give my guards dialogue that my players can overhear. Guards that are talking are an easy tool for exposition, giving the players information about the dungeon and the guards themselves, plus a talking guard is distracted, so easy to bypass.
Monster guards
Lastly, if the players need to sneak past monsters, this may be easier or harder, depending on the monsters. A dragon could easily sniff out any intruders and has excellent hearing, while skeletons possibly can't hear any sounds at all. Orc guards could be stupid and easy to fool with a simple distraction. Undead will probably not follow up on a false alarm, and resume their usual patrols unaware of the player's presence. Plus they usually can't communicate with each other. Give some thought to the level of intelligence of your guards and how this affects their behavior.