On 25 minutes, City made the breakthrough and it was a familiar goal that West Ham have been conceding all pre-seaso.
Elsewhere, there were big wins for Burnley and Brighton.
"In terms of the result, yes", said Guardiola, who nevertheless said he was unhappy with aspects of the performance.
Manchester City have shown they are capable of thrashing any team on their day, so West Ham need to quickly brush themselves off before Brighton.
City have now won 15 Premier League games in a row.
The visitors led at the break thanks to Gabriel Jesus' opener, but moved through the gears after the break as Sterling scored twice. VAR, making its debut this season, was used again to review and eventually validate Sterling's second, when he collected a lofted ball into the box and lobbed West Ham keeper Lukasz Fabianski.
MS employers in ICE raids unlikely to be prosecuted
Officials said they took "a lot of steps" to ensure the apprehended workers could connect with their children. It's only families, fathers, mothers who want something better for the kids, so they come here and just work.
Travis Scott started giving presents
Worldwide reports suggest the sisters might skip the birthday celebrations altogether. She received a auto worth hundreds of thousands of dollars for her 18th birthday.
Pakistan receives little traction globally on Kashmir issue
In a series of Twitter posts, Foreign Minister Qureshi said he thanked his Chinese counterpart for a meeting on a short notice. The Indian Navy on August 10 said it is on high alert and prepared to defeat and deter any seaborne threat with full force.
"In the first half we were sloppy in our passing".
England captain Kane broke the visitors' hearts with goals in the 86th and 90th minutes. In the second half we were better, we were more calm, we played extra passes. "Thankfully a couple of chances fell to me".
Manchester City will play their first home game of the season next Saturday when they host Tottenham Hotspur. This kind of game we can not be precise in our game. "It's down to us players to perform on the pitch". "After we went 3-0 up the game was over".
Pellegrini's team lost their opening four league fixtures last season before the turnaround started, something they can't afford a repeat of if they are serious about challenging for European spots.
Burnley were also 3-0 winners at Turf Moor as an Ashley Barnes double and Johann Gudmundsson's strike condemned Southampton to a heavy defeat.
Manuel Lanzini may then line up on the left while Felipe Anderson switches wings to try and attack City left-back Oleksandr Zinchenko.
Sheffield United grabbed a late point away to Bournemouth on their return to the top flight, with Billy Sharp cancelling out an earlier Chris Mepham strike to salvage a 1-1 draw for the Blades.