Guardiola watched Sterling while he was impressing at Liverpool.
The midfielder said: “Pep coming in was a massive help and for him to be on the phone to me before I even met him was a massive boost.
“He said he always liked my football and had watched me at Liverpool. To hear stuff like that made me go away and think and come back and work harder than ever."
Sterling was slammed on Twitter then but now has a plan to combat the trolls.
Sterling said: “I block that [the criticism] out and simply play football now.
“That's it. I never listen to that.
“Before, every time you take a stroll, you'd be on your phone, on your app, being nosy to see what people are saying when you see your name.
“Now I don't pay it any mind, I simply leave it alone."