Every once in a while, there will be that moment a Dungeon Master realizes something that just makes sense for the situation despite what the rules say. It could even be a clever player who notices something that makes perfect sense in retrospect. It could be introducing two characters to each other. It could be trying to cover the bad guy in grease and catch them on fire. Regardless, these situations can come up in different ways and pose different challenges. They are also massively beneficial and are part of the magic that makes tabletop gaming such an amazing experience in my humble opinion.
In Combat Movement
There are many actions that can be taken in combat, many of which may not seem to make sense from an action economy standpoint. However, they can make sense from a character standpoint. The bad guy might make a dash towards the person holding what they want, and provoking opportunity attacks all the way there. You might also get the idea to fall back to a more advantageous position you didn't see before.
Big Bad Motivations
Often times the bad guys can be in a bit of a haze state, especially at the start of the campaign. We'll know what we want them to do, and what they are generally like but we won't know too much beyond that. Why are they doing what they are doing? What can make them stop? These questions are often overlooked. This is even more common for high ranked underlings. However, in the right moment we can find things that work surprisingly well. It can also be characteristics that we previously didn't realize. If an ally forces us to either hold our fire or launch a fireball anyway, not only is it a tactical decision but also a decision about the character of the person making the choice. Is using magic missile probably worse from the perspective of winning? Yes, but using it instead says something about the character. Aiming to wound or scare player characters away is a similar sort of thing.
I've mentioned this before but dangling multiple plots in front of a party can be an extremely useful strategy. There are also other ways that players can be involved in more than one plot. It could be that something they need to save the world is also needed for a local noble to state their claim, dragging them into political situations. One of the most common times something just makes sense for me is when I'm dealing with multiple plots. In a particularly inspired moment (well, it seems that way at the time at least) I'll have an idea how to connect them together. It could be two plots that were previously unconnected or it can be another connection to add to the fabric of the campaign.
I do have to also give a bit of a warning though. One of the useful things about dangling multiple plots in front of a party is to gently let the party decide what kind of game they want to have and what interests them. However, if we just tie plots together anyway we can remove the element of choice. Instead, it will give more of an illusion of freedom since we will just connect the plots that didn't make it anyway. Of course, if it happens once it probably isn't much of a big deal. However, if you do it enough times that your players will expect it, it will probably be an issue.
Have Paper Ready
While genius can strike in the moment, it can be difficult to remember after the fact. Keep some paper ready for when these kinds of decisions are made. It would be a shame to have a good idea in the moment, start setting stuff up and forget it.
In Combat Actions
Players, due to their decision making process being limit to their characters, often have a chance to more deeply think about their combat actions. While the rest of the party is taking their turn, players can still weigh their options. This often makes for rather creative attempts that aren't covered by the rules. These, more so than other situations, are particularly challenging.
Let's say a party member casts grease on an enemy and another party member tries to catch them on fire using a torch or a fire based cantrip (assuming D&D 5th edition rules). What happens next? The issue is, like I mentioned previously, we risk setting a precedent. While we want this to be effective since it is creative and takes two player turns, we also don't want it to be more effective than a fireball, for example. We also don't want it to be the default combat action going forward either. It should have advantages, disadvantages and also some level of situational dependence. Unfortunately, this is more of a skill than an art from my experience, is learned through practice, and will also be partially dependent on the group in question.
Often times many details are left until later when making a player character. Elements of backstory are a big one that come up often. If you are entering a campaign setting you've never even heard of before, it might take some time to get a handle on it so that you can make those specific details of your backstory. After spending some time in a certain area of with a particular character, however, inspiration can strike. Maybe this was their home city all along but they were trying to keep a low profile and didn't say anything before now. Maybe it turns out the player knows another character but since they were 8 years old at the time, they aren't recognized. Regardless of the means, that time being in a weeds tends to lead to that “oh, that makes sense” moment that helps the character get further developed. I've also seen plenty of players who like this kind of thing as a core part of their gameplay. They want to be thrown head first and improv their way through.