Ahead of Wednesday’s long-awaited public appearance by Michael Cohen, one congressman hinted at having dirt on President Trump’s former attorney, telling one reporter to expect “fireworks” at the congressional hearing.

What many legal experts saw as threatening a witness, Rep. Matt Gaetz (R-Fla.) defended as challenging Cohen’s “truthfulness, veracity, and character” when he claimed in a Tuesday tweet that Cohen had girlfriends and insinuated that details would be revealed during the hearing.

“I wonder if she’ll remain faithful when you’re in prison,” Gaetz wrote, referring to Cohen’s wife. “She’s about to learn a lot...”

After many hours defending his tweet to reporters and even in a floor speech, Gaetz eventually deleted the tweet and said he should have chosen his words better. Still, Gaetz is clearly gearing up for some dramatic made-for-television moments when Cohen is questioned. Gaetz is not a member of the House Oversight Committee, but he’s watching the hearing from the audience.

The not-so-veiled threats, the defiant self-defense and the teased melodrama are pages straight out of Trump’s playbook (although it’s hard to imagine Trump ever giving in to pressure to take down a tweet), which isn’t surprising for a man described in a Politico profile as “Trump’s protege.”

The two seem cut from similar cloth. Like Trump, Gaetz grew up wealthy and followed his father’s path. For Trump, it was real estate. For Gaetz, it was politics.

Gaetz’s father served in the Florida State Senate and ascended quickly to become Senate president. Gaetz, then a member of the state House of Representatives, intended to run for his father’s seat in 2016 but decided instead to run for the U.S. House after his district’s congressman announced he was retiring.

So, Gaetz ran for federal office simultaneous with Trump’s rise through the Republican primaries and general election and was quickly swept into Trump’s orbit. He has worked hard for the president’s trust and has become his body man in Congress. Mess with Trump, you mess with Gaetz.

He led the effort for Republicans to release a GOP memo alleging that an inside job at the FBI was trying to bring down Trump. Gaetz agrees with Trump that the Russia investigation is a “witch hunt,” and he has cast aspersions on Robert S. Mueller III, even drafting legislation for him to resign as special counsel.

“We are now more than a year into this presidency, and there are people in his own government who hate him,” Gaetz told The Post’s Dan Zak last year. “And there are people in this town — in both parties, in the establishment — who want to see him gone,” Gaetz continued. “If they had the nuts, we’d know it by now.”

Zak wrote that Gaetz was “seated behind his desk near a packet of paper titled ‘FBI & DNC messages: Obamagate.’”

Like Trump, Gaetz peddles conspiracy theories and loves the spotlight. He is a frequent guest on cable news — the earlier the better because that’s when the president is watching. But he is not discerning about that shows he goes on, be it left-leaning MSNBC or conspiracy theorist Alex Jones’s Infowars. Like his mentor, he just wants a platform to be heard.

The 36-year-old lawmaker will likely remind most of that guy from high school. He is the popular kid who made just enough trouble to agitate everyone, but then could always talk his way out of punishment.

For someone just entering his second term — he won his reelection last year with 69 percent of the vote — he has already had his share of controversies. As his guest to the State of the Union address in 2018, he invited Chuck Johnson, a known Holocaust-denier who travels in alt-right circles.

Then, just a few weeks ago, at a hearing on gun violence, Gaetz claimed that the real tragedy requiring attention was not guns but rather criminals crossing the southern border, echoing his hero. That enraged two fathers who lost their children in last year’s high school massacre in Parkland, Fla. The fathers stood up from the audience and started yelling at Gaetz in protest. Gaetz asked guards to remove them.

Gaetz was roundly condemned for clashing with the grieving fathers, an incident that prompted a group to start a crowdfunding campaign to raise money for Gaetz’s Democratic opponent in 2020.

“Elected & re-elected w 2/3 of the vote the last 3x I’ve been on the ballot. Won every county in my district the last 4x,” Gaetz tweeted at a critic on Twitter. “This is what makes our republic great - the will of the people. See you on the field.”