The world is often trying to kill you. This is even more true in tabletop role-playing games where the trees themselves can run after you and avenge their brethren. Regardless of the reason, survival elements can come up in a typical D&D game as your players attempt to cross a desert or climb a mountain. With that in mind, I hope to share some of my thoughts for consideration and comment.
What Do I Mean?
For my purposes, I tend to think of survival in tabletop role-playing games as quite a broad idea. Hunger, thirst, exhaustion, and weather effects are the easiest things to think of and generally included in rule sets (in D&D 5th edition they are covered though some probably prefer more in depth rules). I'd also say they are some of the most common ones I've seen. However, I also include things such as dangerous terrain, poisonous food or plants, sickness, ease of tracking and navigating as well. Things that hinder your players from making it to their objective that aren't social or combat are generally a good place to look at. It isn't necessarily always the case, but it leaves room for a lot of creativity. For example, wind might not play a big role for your normal party getting around on horses. On a sailboat, however, it becomes a serious problem as does spending time at sea without being able to resupply.
When talking about survival in tabletop role-playing games, you probably don't want to drop your players in the middle of nowhere and let them try to survive the hunger and cold. Instead, the survival elements are usually present in order to add extra tension and difficulty in accomplishing the main goal. This means that they should generally be impactful, but not overly annoying. They are also not the focus when used in this way. You don't want to annoy your players with this kind of thing.
The situation itself plays a big role in deciding if a survival element will make sense. We can all agree that characters should be wearing warm clothes at -30 Celsius, but before that point can be tricky. There are also many factors that go into it. It might make sense to use the rules for cold situations or make your own situational ones if it's a particularly cold night and one of your players ended up in the river. Those situations where it's obvious that some survival aspect is at play are easy to rule. However, they aren't the only situations where such rules may apply. I've seen someone use the heat exhaustion rules in D&D 5th edition for a quick method to handle a character with a fever (I can't remember if they made changes to it but I seem to recall it reminding me of the heat exhaustion rules).
Who Does it Hurt
Some elements of a game will hurt certain people more than others. If your rules system is class based, it also means some classes take more of a hit from certain survival elements. One example is cold weather. If you decide everyone can wear warm clothing over whatever they usually wear, things will go as normal. However, anyone who needs to rely on their armour will take a big hit if you don't allow them to wear it underneath. There may be some survival situations, such as being poisoned by something or particularly cold weather, where you might decide that a wizard will need to roll concentration. Not handling this like a rule (they don't need to roll every time they are in cold weather) gives you some flexibility as a Dungeon Master to tailor things to the situation but also not expand the rules (keeping it as a ruling, not a rule).
What's the Result?
Hunger and thirst usually do one of two things. It forces the players to slow down and forage for food on their route. The result is they can't travel overland as fast. It also helps your ranger shine if they like that kind of thing. If time is a critical element in your game, this can be a big deal. It also allows your players to plan out their route. They can buy enough rations for their trip and resupply in cities along their path. This might be overall longer than the direct route but could be faster in terms of time because the roads are better. It will also allow the characters to arrive at their destination without taking levels of exhaustion. In some cases, if the path is particularly long without a chance to resupply, the players will need to think of a way to proceed. They might plan for half and forage the rest, they might jump in straight away and not waste time buying supplies, or they might take extra horses or a cart to carry their extra supplies.
A group tends to have a clear cut answer in these kinds of situations. I've seen some prefer to just start moving now and worry about supplies later. If their ranger has a good history of making due just fine, this helps to contribute to the selection of this option. Balancing these kinds of situations can be a bit difficult and also depends on how adverse to risk your players/and or characters are. To tempt players to take the riskier forage option might take a lot for risk adverse groups, or it could be the without-a-doubt best choice for a group that loves risk.
In Context of Travel
I find it easiest to consider survival aspects in the context of travel. It's also the most common situation I've come across and it probably extends to other tables as well. They are factors that players need to consider when traveling and influence their path. A path that might look absolutely nonsensical can be made promising because of the sources of water along it, for example. Beyond the rules dealing with exhaustion, some terrain features overlap with survival aspects. They also behave in a similar way. If your players come across an area with places of quicksand, deep snow (that 10-foot pole can be very handy when going across icy terrain to check for hidden places you could fall into), or swampland, your players are forced to make a choice about the best way to go towards their objective. Similarly, there is a risk with going through the dangerous terrain, and there is the less dangerous but more time consuming way of avoiding it.
These kinds of elements should add something to the game and your players should enjoy them. If they generally don't, you can probably get away with it once or twice. If it's their first time in the northern ice lands of [insert land here], it can help accent their new location. However, if you hammer them with it every 15 minutes of play it could get tedious quickly. In such situations you'd either want the problem to go away as soon as they get proper clothing or not spring it on them in the first place. It's similar to how long everyone enjoys tracking experience or encumbrance. Some people really like how it adds to the world and makes it seem more real while others find it tedious. When used sparingly, such as encumbrance stuff coming into play when trying to move a very heavy object, it disappears into the game and it isn't a problem.