Such an interesting conundrum; one thing I have always tried to ask myself, when I have a team member who seems perpetually unhappy in their role is if they do not have enough in their role to feel fulfilled or if they have outgrown their role.
I have supported many individuals in finding their next job because they had grown discontent in their current role. I find that sometimes a change of profession is the answer or the hard question of if they are bringing in their unhappiness from their personal life into their professional.
There is only so much a leader can do, but asking, outright, why someone is not positive or contributing well to their role can usually help find the source of the problem. Also, sometimes people just want to be heard and seen. By showing them that you see their actions and attitude can be enough for them to become a bit more self-aware of their attitudes.
Professional careers are tough because most people are unhappy with their job, but it is where we spend the most time. It is our job to make the most of it and reminding people of the power of their attitude can sometimes be a great catalyst to improved work environments.