Marcin Gortat had trouble sleeping the night before his Phoenix Suns faced his old team, the Orlando Magic, on Wednesday.

It didn’t matter. The game, itself, was a nightmare.

Dwight Howard won the matchup of the centers, and Ryan Anderson swished one long-range shot after another as the Magic throttled the Suns 103-93.

“I probably gave him too much respect again,” Gortat said of Howard. “I should have attacked him a little bit stronger. Now it is over, and the game is over. He basically destroyed me and the whole team.”

Howard scored 28 points, collected 16 rebounds and blocked three shots to produce the kind of dominant performance Gortat had seen so often as Howard’s backup.

This time, all of those dunks, running hooks and athletic rebounds came at Gortat’s expense. Gortat finished with four points on 1-of-7 shooting, nine boards and three blocks.

“It wasn’t a one-on-one game,” Howard said. “I wasn’t preparing to play Marcin. I was preparing for what’s ahead.”

By “what’s ahead,” Howard meant the playoffs.

With 18 more regular-season games to go, the Magic still need to make plenty of improvements. Coach Stan Van Gundy wants his players to play with more urgency from start to finish. And he wants them to realize that some of the bad habits they have formed — occasional lackadaisical defense, periods of low energy on offense and continuous carelessness with the basketball — simply cannot be erased when the playoffs begin.

The Magic displayed those bad habits Wednesday, despite the easy victory. They allowed the Suns to shoot 48.1 percent from the field. The Magic committed 17 turnovers. And the Magic were outscored 31-22 in the final quarter.

Still, the Magic received a game-high 29 points from Anderson, who hit seven of the 12 shots he tried from beyond the arc. Backup big man Glen Davis added 16 points and seven rebounds.

And, of course, there was Howard’s big contribution.

“Dwight played extremely well, and I thought we defended Marcin’s offense very, very well,” Van Gundy said.

“That was more of a team thing, because Marsh’s game is pick-and-rolls with [Steve] Nash, and we made a real concerted effort to take that roll to the rim away. I thought we did that as well as it can possibly be done.”

Nash finished with 12 points, just two assists and five turnovers as the Suns completed a back-to-back.

The Magic (30-18) needed a victory after they lost Sunday to the Miami Heat and were demolished Monday night by the Chicago Bulls.

The Suns (23-24) were playing on the second leg of a back-to-back. Including their loss Tuesday to the Heat, the Suns dropped to 9-4 since the All-Star break.

The Magic took control early in the second quarter.

Ahead 33-28, Anderson sank a 3-pointer, J.J. Redickhit a running jumper off the glass, Anderson made two of three free throws and Davis swished a fadeaway jumper.

That upped the Magic’s lead to 42-28.