Francisco Cervelli pouted and complained when he failed to make the Yankees’ roster out of spring training last year. He’s thankful for the demotion now.

“I think that God has a perfect time for each person,” he said before the Yankees’ 4-2 victory over the Red Sox last night. “Maybe I didn’t understand last season what happened, but now I know there was a reason.”

Cervelli crushed a seventh-inning homer to left-center and walked, but his biggest play came in the first inning, tagging out Shane Victorino to the end the top of the first, when the speedy outfielder tried to score from second base on a wild pitch and Andy Pettitte forgot to cover the plate.

“If it’s a foot different and he’s safe instead of out [it’s], ‘Oh man, not again, now we’re down,’ ” Brett Gardner said.

Gardner was referring to the series’ first two games, both Red Sox wins. Instead, Cervelli beat Victorino to the plate and an inning later the Yankees had their first lead of the season on Lyle Overbay’s two-run single.

“It’s very important,” Cervelli said. “That’s what we need, a little push and we start doing great things.”

Cervelli, 27, said he grew up toiling in the minor leagues last summer, though he hit just .246 in 99 games with Triple-A Scranton/Wilkes-Barre. Cervelli thinks he is in better control of his emotions now, is stronger and better equipped to handle himself in the big leagues. The biggest difference, however, is his mindset.

“What happened last year, I appreciate things a little more now,” said Cervelli, who has driven in three runs this year — tied for the team lead. “To play every day, I say thank God for the opportunity because I’m healthy and I’m here. This is my dream.”