If you’re driving a car that you recently bought and it seems to be out of commission more than it’s on the road—or it has nagging, repeated problems—you don’t have to stand for those issues.

Michael Sacks, the Director of Communications for LemonLaw.com, a legal advocate for consumers with recurring automotive issues, says you get can paid if you’re dealing with a lemon car that’s been costing you time and money.

Use these five ways to recoup some cash when your car keeps driving you crazy by sending you to the mechanic.

Bone up on your state’s lemon laws

Each state has different rules for what qualifies as a lemon. But generally speaking, state lemon laws generally cover new motor vehicles—such as cars, personal trucks, motor-homes or even motorcycles—when those vehicles have a substantial defect that can’t be fixed after a reasonable number of repair attempts (usually three or four).

In some states, only financed vehicles are covered; in other states, leased cars are subject to lemon laws as well. (For those of you driving an older car, read on, because there’s help for you too.)

If you do have a lemon car, state lemon laws provide for three methods of compensation for your troubles. Plus, federal compensation may net you even more cash to reimburse you for a lemon car.

Get your vehicle repurchased

The first fix for a lemon car is simple: You might be entitled to a complete repurchase of that aggravating vehicle. “That includes taxes, tags, finance charges, your down payment and trade in, minus a mileage offset,” says Sacks.

Under this scenario, you get a check and you don’t even have to pay taxes on it, he adds.

Swap out your lemon car for a new vehicle

Another option for those with a lemon is to do an MSRP to MSRP swap. “It’s basically a trade without depreciation,” Sacks explains. So you might get, for example, a $25,000 credit for a new car even if you only paid $19,000 for your original vehicle.

This process allows you to have the same, higher amount of equity in your new car after a swap. However, in some states a mileage offset will apply, according to Sacks.

Get cash to offset the problem your car has

Yet another way to get financial relief for your lemon car is to receive monetary compensation to offset the diminished value of a vehicle. When you do this, “you keep your vehicle and your vehicle isn’t branded. It’s not on CarFax, and the warranty remains in effect,” Sacks says.

Furthermore, you don’t pay taxes on the money granted to you as compensation for a lemon car. And when you later sell the car, you don’t have to disclose those funds either, Sacks notes.

So how much cash can you get under this method? It depends on the nature of the problem and how much it affects the car. But it’s common to get thousands of dollars.

LemonLaw.com is the online home of the law firm Kimmel & Silverman, which offers free information and no-cost help for consumers who have bought lemon cars. The firm also helps with dealer fraud cases, including dealer misrepresentation, odometer rollback and delivery scams.

LemonLaw.com has ASE-certified mechanics that review car reports. They use their expertise to assess a range of problem issues—like how much a vehicle is diminished from a check engine light that keeps coming on, or a window constantly falling into a door, or perhaps a chronic brake problem that won’t go away.

The cash compensation option also differs from the first scenario in two major ways. “If you get a buyback or repurchase, then the car is branded,” says Sacks. “But if you get cash damages, then you’re going to release your rights to certain things.”

Use federal law to get paid

If your car doesn’t meet any state lemon law guidelines, it still might be protected under federal law.

The specific law in question is called the Magnuson-Moss Warranty Act. It’s a federal law that basically says that if you have any car problems and they’re not fixed properly, you can file a suit against the car company on the grounds that, as a consumer, you didn’t get what you paid for. The company named as the defendant would be the car manufacturer, not the dealer; the dealership is just the middleman.

By invoking your rights under federal law, you’re also entitled to cash compensation. And similar to state lemon law protection, this federal money you get is non-taxable, it doesn’t affect resale value, and you don’t need to disclose it to a buyer down the road.

Best of all: unlike state lemon laws, the Magnuson-Moss Warranty Act can also help those with used cars too.

“Most people don’t realize that their sour car could pay them for the aggravation that they’ve been through,” says Sacks.

Get your legal bills paid

Finally, if you have to sue over a problem car, you can be entitled to more than just the replacement cost for the vehicle or the funds necessary to fix the car. You might also recoup your legal costs.

According to Sacks, the “fee shifting provisions” of state lemon laws and federal warranty laws work tremendously in a consumer’s favor. In a nutshell, “if you prevail in court, [the auto manufacturer] must pay attorney fees on top of what you receive,” Sacks says.

“It’s often a lot easier than people think,” he adds.

If you think your car is a lemon, attorneys from LemonLaw.com provide free legal help for consumers in the District of Columbia, and 13 states: Pennsylvania, New Jersey, New Hampshire, Connecticut, Delaware, Wyoming, Massachusetts, Michigan, Ohio, Tennessee, New York, Wisconsin and Maryland. In all other states, the firm refers consumers to legal specialists who can help. Consumers nationwide can also call the firm’s toll-free number: 800-LEMON-LAW.

Lynnette Khalfani-Cox is a personal finance expert and co-founder of the free financial advice site, AskTheMoneyCoach.com. Follow Lynnette on Twitter @themoneycoach and Google Plus.