The left-back, who has played just 27 minutes of football since November while struggling to recover from a knee injury, was filmed in a Manchester nightclub at 3:30 am last Saturday.
Guardiola has in the past made clear his frustrations with Mendy, who has been beset by injury problems since joining City from Monaco for £52 million ($68 million) in 2017.
The manager had strong words with the Frenchman in September after he was nearly three hours late for a treatment session, having attended an Anthony Joshua boxing bout in London the previous evening.
In February, Mendy caused his manager more irritation by claiming in an Instagram post that he was in Hong Kong, without his manager’s permission, although the defender later clarified the post by saying he was joking.
Guardiola has suggested previously that he is considering signing another left-back before the start of next season, having been short of options in that area because of Mendy’s injury.
But if the defender can stay fit and play consistently well then Guardiola is likely to give him opportunities.
– Left-back shortage –
“What we want to do is work with him to protect his knee, his condition, to help us, because we need him,” Guardiola said.
“We have played two seasons without a left-back. That is a reality, so in the first season, Fabian Delph helped us incredibly and Danilo as well, he was incredible in that position, and this season Oleks (Zinchenko).
“And we need him. Hopefully this part of the season and in the future, next season, he can be fit.”
Guardiola said that he wanted to work with Mendy to get the best out of the player.
“He’s a nice guy, he has an incredible heart,” he said. “He is a funny guy. Sometimes I have to understand his culture, where he has come from.
“It’s not the first time that one guy goes to dinner outside because he doesn’t have a game, and goes with his brother and his friend, to eat something, to drink something. It’s not the first time and it will not be the last one, so it is what it is.”
The City boss appeared relatively unconcerned that Mendy had been filmed dancing at a nightclub in the early hours.
“Dancing? I don’t know if he danced,” Guardiola said. “Really, I don’t know. I was not there. But from what I saw sometimes with his celebrations in the Premier League, he’s not a bad dancer. Really not.”
Mendy, who is just about fit again after missing a large part of the season with his knee problem, is likely to play a part as City attempt to complete the quadruple of Champions League, Premier League, FA Cup and League Cup.
Guardiola, whose side take on Brighton in the FA Cup semi-finals at Wembley on Saturday, said success would ultimately be down to the players and that he was enjoying the moment.
“We cannot achieve important titles without important players saying ‘guys I’m here’,” he said. “I don’t play. It is a moment for them, definitely.”
“I feel the pressure in November or December when we are saying ‘wow, there are five or six months left and we are out of one competition or not in the next round of the Champions League’,” he added.
“Now it is a joy, an incredible moment. We’re trying to get to an FA Cup final and then keep running.”
Download our app and read this and other great stories on the move. Available for Android and iOS.