Match ends, West Ham United 4, Burnley 2.
West Ham manager Manuel Pellegrini said Felipe Anderson put in a "massive" performance as his two goals helped the Hammers beat Burnley.
The Brazilian midfielder joined the east London club from Lazio for £36m in July, but has struggled for consistency thus far, scoring just one goal before Saturday's game at London Stadium.
Pellegrini even said Anderson was "bad" in West Ham's Carabao Cup defeat to Tottenham, in which he was replaced by Robert Snodgrass at half-time.
"I said before the game that maybe some players need more time to adapt to the league, but his commitment has always been 100%," said Pellegrini.
"I talked a lot with him, and there was never a chance of him not playing. He knew from the beginning that despite playing bad against Tottenham, he was going to play. It was a massive performance."
The Hammers opened the scoring when Arnautovic dispossessed James Tarkowski before racing clear and firing home before Johann Berg Gudmundsson slotted home to equalise just before the break.
The hosts then retook the lead when the excellent Anderson curled a shot past Burnley keeper Joe Hart before second-half substitute Chris Wood's thumping header hauled the visitors level again.
Anderson, who was at the heart of everything West Ham did well, scored his second of the match six minutes from time, capitalising on some sloppy Burnley defending.
Hernandez completed the victory in injury time with a fine dinked finish which finished off a move started by Anderson in midfield.
It was a deserved victory for Pellegrini's side, whose previous victory was over Manchester United on September 29, are now 13th in the table two places above the Clarets.
Burnley, who have now lost six of their past nine games against West Ham, had Hart to thank on several occasions, with the former England and Manchester City goalkeeper saving well to deny Arnautovic either side of the break.
Despite a winless October, the Hammers dominated throughout, slicing through Burnley at will, with Anderson the key player.
The 25-year-old Brazilian took more touches (103) and played more passes (75) than anyone else on the pitch, illustrating his heavy influence on the game.
He scored West Ham's second, with a precise finish after being found in space by the excellent Grady Diangana.
And he claimed his second goal to restore West Ham's lead, his low shot cannoning into the net via a deflection off a despairing Ben Mee.
He was also involved in his side's fourth, it was his sublime cross-field pass that began the attack which led to the goal.
"I am delighted for him because we know what he can give us," said Pellegrini of Anderson's performance.
Young Englishman Diangana also stood out. The 20-year-old winger was direct in his approach and he gave Clarets left-back Charlie Taylor a torrid afternoon.
He made five key passes, more than any of his team-mates, and provided the assist for the Hammers' second goal.
After successive thumpings by Manchester City and Chelsea, Clarets boss Sean Dyche would have looked at this match as one his side needed to take points from.
But despite their resilience, which saw them equalise twice, they did not deserve anything from the game.
They were forced onto the back foot from the first whistle and struggled to gain any momentum at any point.
Dyche was animated over what he thought was a foul in the build-up to West Ham's second goal, but ultimately it proved inconsequential as the Brazilian stuck again before Hernandez added a fourth, consigning Burnley to their third defeat in a row.
They have conceded 13 goals in their past three league matches, and it could have been more against the Hammers with Mee and Hart both putting in impressive performances.
West Ham United boss Manuel Pellegrini: "We needed to win because we have had a lot of games where have created chances but not won. Yes, we could have scored more.
"The first and most important thing is we won the game. We have been playing well and creating chances but we have either drawn or lost. We trust the way we play. I think the fans enjoyed this and in the moments of bad results I have always felt they were behind the team."
Burnley boss Sean Dyche, speaking to Match of the Day: "We reacted well to falling behind. The mentality and energy were good in the first half. The third goal is a real blow and we are chasing the game when they score the last one.
"I'm not disappointed with the mentality of the team but we can't give away the ball so cheaply. There are some details in that game that need working on."
West Ham and Burnley both face away matches next Saturday. The Hammers travel to Huddersfield, while the Clarets face Leicester City at King Power Stadium (both 15:00 GMT kick-offs).
Match ends, West Ham United 4, Burnley 2.
Second Half ends, West Ham United 4, Burnley 2.
Robbie Brady (Burnley) is shown the yellow card for a bad foul.
Robert Snodgrass (West Ham United) wins a free kick in the attacking half.
Foul by Robbie Brady (Burnley).
Ashley Barnes (Burnley) is shown the yellow card.
Goal! West Ham United 4, Burnley 2. Chicharito (West Ham United) left footed shot from the centre of the box to the top left corner. Assisted by Michail Antonio.
Substitution, West Ham United. Angelo Ogbonna replaces Marko Arnautovic.
Corner, West Ham United. Conceded by Ben Mee.
Attempt saved. Felipe Anderson (West Ham United) right footed shot from outside the box is saved in the top centre of the goal. Assisted by Robert Snodgrass.
Matthew Lowton (Burnley) is shown the yellow card for a bad foul.
Felipe Anderson (West Ham United) wins a free kick on the left wing.
Foul by Matthew Lowton (Burnley).
Substitution, West Ham United. Michail Antonio replaces Grady Diangana.
Chris Wood (Burnley) hits the bar with a header from the centre of the box. Assisted by Charlie Taylor.
Goal! West Ham United 3, Burnley 2. Felipe Anderson (West Ham United) right footed shot from the centre of the box to the bottom right corner.
Attempt blocked. Marko Arnautovic (West Ham United) left footed shot from the centre of the box is blocked. Assisted by Grady Diangana.
Foul by Grady Diangana (West Ham United).
Ashley Westwood (Burnley) wins a free kick in the defensive half.
Attempt blocked. Johann Berg Gudmundsson (Burnley) left footed shot from outside the box is blocked. Assisted by Chris Wood with a headed pass.
Marko Arnautovic (West Ham United) wins a free kick on the right wing.
Foul by Robbie Brady (Burnley).
Declan Rice (West Ham United) wins a free kick in the defensive half.
Foul by Ashley Barnes (Burnley).
Felipe Anderson (West Ham United) hits the right post with a right footed shot from the left side of the box. Assisted by Marko Arnautovic with a through ball.
Offside, Burnley. Matthew Lowton tries a through ball, but Ashley Barnes is caught offside.
Goal! West Ham United 2, Burnley 2. Chris Wood (Burnley) header from the centre of the box to the bottom left corner. Assisted by Robbie Brady with a cross following a corner.
Corner, Burnley. Conceded by Aaron Cresswell.
Corner, Burnley. Conceded by Fabián Balbuena.
Substitution, Burnley. Robbie Brady replaces Aaron Lennon.
Foul by Grady Diangana (West Ham United).
Charlie Taylor (Burnley) wins a free kick in the defensive half.
Foul by Fabián Balbuena (West Ham United).
Ashley Barnes (Burnley) wins a free kick in the defensive half.
Attempt blocked. Grady Diangana (West Ham United) left footed shot from the right side of the box is blocked.
Attempt blocked. Declan Rice (West Ham United) right footed shot from outside the box is blocked. Assisted by Chicharito.
Substitution, Burnley. Chris Wood replaces Sam Vokes.
Substitution, Burnley. Ashley Barnes replaces Matej Vydra.
Attempt blocked. Chicharito (West Ham United) right footed shot from the centre of the box is blocked. Assisted by Marko Arnautovic.
Offside, West Ham United. Grady Diangana tries a through ball, but Pablo Zabaleta is caught offside.