The 22-year-old, who has been in top form for City this season, attracted criticism for his below-par performance in the World Cup qualifier against Malta last month.
Now, ahead of the England's games against Slovenia and Lithuania, Guardiola has advised Sterling to keep his focus on his game.
He said: "Raz has to know that the job is not easy, so he cannot expect it always going well.
"I want to see, when it's going bad in the national team, the way that he reacts.
"He mustn't complain. Ideally, he'd say, 'OK I'm here, manager/coach. Gareth Southgate/Pep, I show you how good I am.' That is the only way to become a better player."