If Medicare refuses to pay for a medical service, device or prescription drug you believe you need, don’t dig into your own pocket without first fighting back. Consumers who understand the multi-step Medicare appeals process have a good chance of winning it.

The steps you need to take differ depending on whether you have original Medicare, a Medicare Advantage private plan or a Part D prescription drug plan. No matter what type of coverage you have, however, here’s how you can tilt the odds of getting your claimed covered in your favor.

1. Keep meticulous records. Don’t throw away any documents that pertain to your treatment or insurance. Keep for about seven years the Medicare Summary Notices (MSNs) that you receive once every three months or so. The MSN shows the services and supplies that your health care providers have billed to Medicare, what Medicare paid and the amount you may owe.

If you’ve misplaced the MSN you need, call Medicare (800-633-4227) and ask for a duplicate.

Related: To Shred or Not to Shred?

2. Craft an airtight appeal. You’ll increase your chance of winning if you mention the reason Medicare gave in its MSN for denying your claim, says the Medicare Rights Center, a nonprofit consumer group with a national helpline (800-333-4114).

You can also get help from your State Health Insurance Assistance Program (SHIP), which provides free insurance counseling . To find your SHIP, go to Medicare.gov.

The Medicare Rights Center says patients who fight a denial are more successful when their doctors join the battle. Ask your primary physician, as well as any specialists involved in your care, to write letters that support your argument.

Related: 7 Signs It’s Time to Dump Your Doctor

3. Stick to deadlines. Medicare has strict deadlines for filing appeals. You may be able to get away with filing late, but only if you can show good cause. Good cause might include being too sick to handle your business affairs, for example.

Follow the steps for your type of coverage. There are five levels of Medicare appeals. The first two differ depending on what type of coverage you have.

  • If you have original Medicare, you have 120 days from the date you got the MSN denying your claim to file your initial appeal. You’ll generally get an answer from Medicare within 60 days. (You can ask Medicare to expedite your case if you believe that waiting months for a decision could seriously harm your health.) Losers can appeal to a Qualified Independent Contractor, a service provider Medicare hires to weigh second level appeals.
  • If you have a Medicare Advantage plan and it won’t pay for a service or item you want, ask your insurer to reconsider. Typically, your insurer will first tell you verbally that it won’t cover a particular service or device. The plan will then send you a written Notice of Denial of Medical Coverage, which you should receive within 14 days. You’ve got 60 days to appeal. Losing petitions move automatically to the next level of appeals, the Independent Review Entity (IRE). Medicare hires these contractors.
  • For Part D drug plan appeals, the process is the same whether you have stand-alone Part D insurance or a Medicare Advantage plan that includes Part D coverage. If your pharmacist says your plan won’t pay for a prescribed drug, call your insurer to find out why. If the drug is not on its list of covered medications, ask your doctor to substitute a comparable drug that’s on its formulary. If that’s not an option, you can appeal. Ask your doctor to appeal on your behalf or to at least help you, advises the Medicare Rights Center. You must first file an exception request with your insurer. The rules vary by plan, but all require your doctor to send a letter supporting your plea. If the answer is no, you can file a formal appeal, which should also include a letter from your doctor. Lose again and you can petition an IRE.

Related: These Prescription Drugs Are the Most Likely to Hurt You

Give it at least three shots. Don’t give up if you lose your first two appeals. Your chance of prevailing if you try yet again is far greater, according to a 2012 report by the Inspector General of the federal Department of Health and Human Services. Indeed, 56 percent of third-time appellants won.

To take your case to the third level, which is a hearing before an Administrative Law Judge, at least $150 must be at stake. If the judge rules against you, you can petition the Medicare Appeals Council.

The last stop is federal district court, but only if at least $1,460 ($1,500 in 2016) is at stake.

Denise Topolnicki is the author of How to Raise a Family on Less Than Two Incomes (Broadway Books).