As an actor, I put myself in a position where it isn't, in fact, funny. The details of that will depend on the situation. What am I trying to achieve by saying what I'm saying, the way I'm saying it? Is it important? What do I expect them to do in return? Do I even think it's funny?
In short: if it's not funny to the character I'm playing, then my face will be naturally straight. That naturalness reads better to an audience than any trick I could employ. It looks real because it is real... as best I can achieve under the unreal circumstances. No two straight faces will be the same because the circumstances are different.
Now, that's not actually the same thing as a "deadpan" face, which an audience recognizes as a whole separate thing. A deadpan face is deliberately exaggerated and unreal. The fact that it might break into a smile at any moment is part of what makes it work.
To play a role like that I might use any of those tricks: biting my lip to distract myself, forcing my face to be rigid, thinking about something else. Those are the things a person might do, and therefore something the character would do.
I'll admit, none of this always works. I had a very deadpan line to deliver while another character was literally dying of loud farts for several minutes. (That sounds puerile, and it is... but the fact that this was a Shakespeare play somehow makes juvenile jokes hilarious.) I'll be honest that it actually took weeks of rehearsal before I could really deliver the line straight.
Still... the basic acting technique applies. Acting is the craft of being truthful in untruthful circumstances. If I need a straight face, I need to know why I need a straight face, what I'm saying and what I'm concealing, who I'm talking to and what the circumstances are. That's how all acting works (at least, the way most modern actors approach it). You fool the audience because you're truthful with them... after finding the truth yourself.