Dealing with a new medical issue can upend even the most organized people and families. Besides the emotional and often physical side effects that accompany such diagnoses, many patients also find themselves confronted with multiple doctors’ office or hospital visits and new medication requirementsall of which can cause financial strain.

A recent report by the Kaiser Family Foundation and The New York Times found that 26 percent of U.S. adults between the ages of 18 and 64 said they or someone in their household either had problems paying or were unable to pay their medical bills during the prior year.

What’s more, in 2017 the Consumer Financial Protection Bureau found that 59 percent of people who had been contacted by a debt collector said it was for unpaid medical services.

But by keeping track of appointments, budgeting for their cost, and understanding what can help you save on medical expenses during the early stages of treatment, you can stop worrying about your wallet and start focusing on your health.

Start a budget

While some medical expenses can’t be planned for, there are many that recur annually, including biannual dental cleanings, visits to a primary care physician and checkups for folks that see assorted specialists, kids’ braces, or scheduled procedures for non-life-threatening issues such as a knee replacement.

Smart consumers may start each year mapping out the medical visits they can expect, then back into what expenses they may be on the hook for. Then, by reviewing your income, fixed expenses such as what’s owed on a mortgage, home and auto insurance, groceries and gas, and tuition and utilities, for example, you can amend your discretionary spending on things such as dining out, some clothing purchases and travel, to make up for any shortfalls. Try free online tools like SmartAsset’s Budget Calculator to help you get started.

Some may take this a step further and schedule their visits based on their expected output at different times of the year. For example, if you typically spend more during the months of November and December, on holiday entertaining and travel, you may opt to make your appointments in the spring when your cash flow isn’t as stretched.

Look into an HSA or FSA

If you are enrolled in a high-deductible health insurance plan, you may consider enrolling in a tax-advantaged Health Savings Account (HSA), into which you may contribute $3,450 as a single person or $6,850 for a family. In return, you’ll receive a debit card or checks which you can use to pay for qualified medical expenses such as deductibles, copays or coinsurance.

The cost benefit to you is that your contributions are deposited pre-tax. You also don’t pay tax on your account’s growth, if it is invested, nor are you taxed when you tap into the account, which can be rolled over from year to year.

Opt for a Flexible Spending Account (FSA), and you’ll be able to contribute $2,650 (if you are married each spouse can contribute this amount) to this account which goes beyond what an HSA covers and allows you to use it for expenses like prescription medication and some over-the-counter products, crutches and some diagnostic blood tests. It generally does not roll over at the end of the year, unless your employer opts for a short grace period, nor may it be invested.

Use an app

Some of us just can’t work magic with numbers — and that’s okay! Luckily, with modern technology, a host of apps are at your disposal to help with money. These apps can do anything from help set your budget to analyzing your spending habits to making automatic deposits into your savings account.

This list of suggestions from Forbes has a whole host of options for you to choose from, no matter your level of experience with managing expenses.