What, by hiding in say... a closet?

Bit contradictory there!
"Don't hide in a safe place, but don't stand in plain sight!"
No not at all, there are places to defend that are not closets. I mean when all four survivors are on top of each other melee'ing until the cows come home = boring.
I must admit i've been guilty of it in the past - but I do try to make an effort these days to make games interesting when playing.
Some more tips:-
Survivors
1. I find that a nice spread of weapons is useful in defending different situations. If all four have auto shotties, the smokers can grab you without much difficulty, whereas if a couple have M15's and the other two have a hunting rifle and an auto shotty.
2. Try to organise whos going to throw a pipe/molo. Too often I see 2 people chuck a pipe into an open area at the same time.
3. Save the Pipe bombs for when you're in trouble, having been boomered or such like and need a bit of space to breath.
Infected
1. Smokers should try and drag people backwards in the maps. This means the remaining team can prepare for the next wave and the survivors have to go back to help out. Exceptions can be when there is a car with an alarm or a nice place to drag someone off a ledge.
2. Try not to spawn until the very last second, especially as boomer. This cuts down the sound location.
Other
1. When you're dead - stick around and help out your team. If you press the shift key you can free float camera and zoom around and spot potential ambushes!!

Communicate these to your teammates. You can also read the other teams teamchat for some reason!