Rodri opened the scoring after 30 minutes before Kevin De Bruyne capped off a magnificent performance with a 62nd minute goal.
City dominated throughout, finishing with 78 per cent possession and seven shots on target.
The result leaves West Ham one below the relegation zone with 12 games remaining.
Speaking to Sky Sports after the game, De Bruyne said: "It was OK.
"I think we saw its been three weeks without football and we felt a little bit of rustiness but we played a good game."