Captain Marvel could offer practical help. If the Young Justice is sad because of a threat they can't handle, he could use his powers to assist. He might train them as well, which would not only improve their skills but also boost their confidence. This could be a great way to turn their sadness into determination in the fanfic.
In the fanfic, Captain Marvel might bring a different perspective. Young Justice may be sad because they're seeing things in a narrow way. Captain Marvel, with his vast experience, can show them new ways of looking at problems. His positive attitude and can - do spirit could be infectious, slowly changing the mood within the team from sad to hopeful.
He could inspire them. Captain Marvel's strong sense of justice and his amazing powers can be a source of motivation for the sad Young Justice members. Just seeing someone so powerful yet still fighting for good can lift their spirits.