Last year, Brian Vastag got a big legal settlement.

Vastag used to be a science reporter for the Washington Post, covering topics like astronomy, dinosaurs and human evolution.

Then in 2012, when he was in his early 40s, he got sick with chronic fatigue syndrome.

“I was basically bed-bound for most of 2013 and part of 2014,” Vastag said. “It was very hard for me to get out of the house and do anything.”

Vastag eventually had to stop working. He filed a claim with his company’s disability insurance provider, Prudential, and was denied. So he hired a lawyer, sued, won and then got an additional settlement.

But that pile of money shrunk quickly.

First, he had to pay his lawyer, who was working on contingency. Lawyers’ fees can run up to 30 percent, 40 percent, even 50 percent.

“So you know, the settlement I got from Prudential, the attorney’s fees never touch my bank account,” Vastag said. “I never saw that money.”

Then came the taxes. And this is when he got a pretty big shock. His accountant told him that under the 2017 tax reform law, he’d have to pay taxes on the entire settlement, including the part that went straight from the insurance company to his lawyer.

“It makes it harder for me to have a stable financial plan,” Vastag said. “It’s a big hit, and it was a hit I wasn’t expecting I’d have to take.”

Taxes are complicated, and there is a lot of fine print here. But in summary, the 2017 tax law cut taxes for a lot of people and companies. But it also made changes to the tax code to make up for some of the lost tax revenue.

This is one of those changes.

Before 2018, if you had to pay taxes on a legal settlement or money you got in a lawsuit, you generally didn’t have to pay taxes on the part of it that went to your lawyer.

Now, with just a few exceptions, you do.

“I think disbelief is probably the, you know, the biggest reaction,” said Rob Wood, a tax lawyer in California who has a lot of clients who get settlements. This change applies to a seemingly endless list of cases, Wood said.

“You sue somebody for defamation,” he said. “You sue a stockbroker or a financial adviser for bad advice. You sue your neighbor for trespass. You sue the police for false arrest.”

And having to pay taxes on lawyer’s fees can make a big difference, especially for people who are relying on settlement money to make them whole.

Elijah Armstrong, a 22-year-old student at Pennsylvania State University, was in that situation.

When Armstrong was in high school in Jacksonville, Florida, he ran into a problem: The lights in his math classroom kept flickering.

“I am a photosensitive epileptic, and that caused me to have seizures,” he said.

He couldn’t get the school to move the class or fix the problem in another way. So eventually he sued and later, after graduating, he got an $80,000 settlement.

A third of that went to his lawyer. But this was before the new tax law, and he didn’t have to pay taxes on that third. That was a big deal, because he had bills to pay from that time in his life: “hospital bills, there were another set of lawyers that I had to pay for, and then, I come from a single-parent household and my mom had to take off work to take me to the hospital,” he said. “Like, the goal was to break even because I had lost so much money.”

Breaking even could be even harder now for people who win or settle lawsuits because there’s potentially an even bigger tax bill waiting for them.