Here are a few options…
“Quit whining.” (US English, extremely direct/possibly rude)
“Complaining isn’t going to help.” (Direct and firm)
“Stay positive!”
“Let’s keep a positive attitude (about things/this).” (Clear and direct but gentler)
“Surely there’s a silver lining.” (Gently suggestive/very mild)