"Whistling in the dark" is an idiom for pretending not to be frightened in a threatening situation. Say you're walking through a park at night, someone's following you.... start whistling. It makes you feel better, plus you hear more that the sound of your own footsteps.
It can also have negative connotations; ie not taking a grim situation seriously enough. You're broke, your bills are overdue, just got fired, and your car broke down, but you decide to have a beer and worry about it later. You're whistling in the dark.