Rex Ryan knows the New England Patriots always make the right decision.

The Patriots shocked the NFL when they dealt backup quarterback Jimmy Garoppolo to the San Francisco 49ers on Monday.

Garoppolo was perceived by many to be the heir apparent to Tom Brady, but Brady’s high-level play forced New England to deal the 26-year-old Garoppolo for a 2018 second-round draft pick.

The Patriots on Wednesday signed Brian Hoyer to a three-year deal to replace Garoppolo as Brady’s backup.

While some members of the media have been skeptical of the trade, Ryan and Matt Hasselbeck praised Bill Belichick’s “genius” on ESPN’s “Sunday NFL Countdown.”

“You’re playing for the world champs,” Ryan said, “and in the best organization in football right now because, by the way, Tom Brady is still there. And look at this trade specifically. They trade — they don’t just get a second-round pick for Garoppolo, OK. They also get the backup quarterback. So they knew they were getting the backup quarterback as well.”

And that’s where Hasselbeck believes the Patriots hit the trade out of the park.

“And that’s the genius in this trade, I believe, is that they held onto Garoppolo for as long as they could,” Hasselbeck said. “You know their risk management percentages, this is the best that they could hope for. They had him for half the year. If anything went, if Tom, you know, loses, breaks a shoelace, hurts his thumb, whatever it might be they’ve got a backup.

“Now they don’t have the backup, but they got the value back. But what’s most important about this trade is they trade him to a team where they can ensure they get the backup they want in Brian Hoyer.”

The trade also was brilliant for the 49ers, as they got their QB of the future after reportedly trying to acquire Brady first.

Thumbnail photo via Kyle Terada/USA TODAY Sports Images