Rooney netted his first on 18 minutes when his penalty was saved by Joe Hart, but he headed in the rebound.
Everton had a second 10 minutes later, Rooney slotting in unmarked after a Tom Davies cross.
Jordan Pickford saved a Manuel Lanzini penalty, before Rooney's driven strike from well inside his own half, following a Hart clearance, completed his treble.
The watching Sam Allardyce, who is set to be confirmed as Everton manager, then saw Ashley Williams make it 4-0.
Victory moves Everton up to 13th. West Ham are 18th.
Everton: 2 Dec v Huddersfield (H)
West Ham: 3 Dec v Man City (A)