:) - that is a smiling face.
:D - that is a laughing face.
:( - that is a frowning face.
:| - that is a straight face.
Now, imagine someone has told a really funny joke - but you're at a funeral. You want to laugh, but you're at a funeral. So instead of having a laughing face :D, you try to keep a straight face :|.
Or, imagine your boss is doing something very embarrassing. If you smile :), she will fire you. So, you need to keep a straight face :|.
That's keeping a straight face - not laughing or smiling when it might be inappropriate to laugh or smile.