"Don't" is my answer. You know all sorts of things your character doesn't (how to make electricity from spinning a spool of copper wire around a magnet and then using it to make another piece of wire glow to make light, for instance) and you don't let your characters behave based on that. You have to run your character like, make it act like it doesn't know the piece of information.
Addendum in light of comments below:
I'll be more specific about the question I am asking back of you to illustrate my answer (which I did not mean to look the same as the original question): how do you avoid presenting your knowledge of modern day solutions to in-game problems where it is inappropriate to that setting? You already do that, I would imagine, or you would not be asking the question.
Introspection is a very useful tool. Everyone makes "mistakes" and lets prior knowledge affect their character's actions and it's part of the game for everyone to move past it with as little disturbance as possible - much like actors do if someone fluffs their lines: they ad lib your way back onto the script. Introspection, deliberate self-analysis, gives you tools to use to limit this. Its the same for GM's.
By "Don't" I am responding to the example situation you give: "For example, it can be hard to act like you don't know your friends are in trouble in the next building, and not go over there just to have a "random look" and oh surprise find something you, as a player, already knew you'd find. Finding myself in such a situation can be avoided if the GM splits the group of players or uses other information-control tricks, but that's not always done."
It's not the GM's job to enforce your roleplaying, that's no fun for anyone. It's your responsibility to play your part, even if it is hard, even if the character in the example dies as a result. That's the story. That's the "risk".
So my advice is if you know a fellow character is in trouble and your character does not, then "don't" make your character go over to check it out by accident unless it really is reasonable that they do so. It's effectively role-play cheating, as much as using your knowledge of maths to solve the angle at which your character should loose a crossbow bolt at to hit the target to save the other character's life would be. They probably don't know the maths and so you just "Don't" do it.
That's what I mean by "Don't". There is no magic pill that makes it ok to act on meta knowledge. If you do then it's your problem if you feel bad about it.
But then again don't worry about it too much (which is why my initial answer was comparatively short), it's the story that's most important to having fun and if it's best for the story to save the other character then actually don't feel too bad. Also, to consider is that characters die. It's part of the game, part of the fun, part of the risk. Took me years to figure that one out.