Manchester City dominated the match throughout, and should have really scored a few more goals against a disappointing West Ham.
City started the game brightly, with Aguero and David Silva both firing wide early on.
Despite these missed chances, City fans didn't have to wait long to celebrate. David Silva played in Nolito down the left who crossed for Sterling who made no mistake with the finish.
Less than 20 minutes into the game and City had a 2-0 lead. Kevin De Bruyne's excellent free-kick from the right was met by Fernandinho who powered his header past Adrian in the West Ham goal.
De Bruyne continued to threaten and fired a free-kick just over the bar and then skimmed the crossbar after a brilliantly-worked move from Man City.
West Ham were reduced to a couple of half chances in the first 45 minutes, with Ashley Fletcher firing a shot and a header wide.
Just after the break, Guardiola's side had the ball in the back of the net once again but it was rightly ruled out as there was an offside in the build-up to Nolito's finish.
Nolito then had another attempt at goal, but fired his effort into the side-netting.
Just before the hour mark and West Ham got themselves back into the game from nowhere. Masuaku crossed from the left and Michail Antonio got above the City defence to head home.
However, despite being closer to City on paper, the gaps between the two sides only widened as Manchester City created chance after chance.
Nasri made his first appearance of the season and could have had a couple of goals. Aguero and Sterling also hit the side-netting.
However, Sterling put the game to bed in the second minute of injury-time when Raheem Sterling scored with a wonderful goal. The winger rounded Adrian but was left with a tight angle, but somehow managed to squeeze the ball between the near post and defender James Collins.
It was another convincing performance for City who created a number of golden opportunities and could have easily scored five or six. As for West Ham, Hammers fans will be worried about the club's start to the season.