Prestigious career fields such as law and medicine earn some of the highest salaries in the country. Unfortunately, they also go hand in hand with major student loan debt, which can have a serious impact on your finances.

The average medical degree, for example, costs between $138,368 and $234,672. Going to a top law school means spending an average of $180,879 on tuition.

Even with a high income, paying back this kind of debt is extremely burdensome. Fortunately, there are student loan forgiveness and assistance programs that can help. If you work in one of the following careers fields or are considering doing so in the future, you could get some or all of your student loans forgiven. Keep in mind you may not qualify for forgiveness even if you work in one of these fields, as qualification often relies heavily on your employer, not just your job.

Six high-paying careers with student loan forgiveness programs

1. Lawyers

Practicing lawyers may have a number of forgiveness options.

Those who work in qualifying nonprofit and public service jobs could be eligible for the Public Service Loan Forgiveness Program (PSLF). This program forgives the loans for any professional in an eligible public service position after 120 qualifying monthly payments.

In addition to PSLF, there are a few other forgiveness and assistance programs designed specifically for lawyers. Here are three programs available nationwide:

Justice Department Attorney Student Loan Repayment Program (ASLRP): Awards up to $6,000 a year with a maximum of $60,000 to qualifying borrowers who work with the Justice Department for three years.

John R. Justice Student Loan Repayment Program: Gives assistance in the amount of $10,000 a year with a maximum of $60,000. You must be a public defender or state prosecutor who has worked for at least three years in a governor-designated state agency.

Herbert S. Garten Loan Repayment Assistance Program: Awards up to $5,600 to about 70 qualifying attorneys every year using a lottery system.

Beyond these programs, there are others offered on the state level. For instance, the Oregon State Bar program offers $7,500 a year for three consecutive years to qualifying state residents who work as attorneys.

Finally, some schools of law offer aid to qualifying alumni. The University of Virginia, for example, offers 100% forgiveness to graduates who work in public service and earn less than $55,000 a year. Check to see if your alma mater gives assistance to any of its graduates.

When it comes to retirement, 60s are the new 50s

2. Doctors

Like lawyers, doctors working in nonprofits could get Public Service Loan Forgiveness, but PSLF isn’t the only option for physicians. In fact, MD Magazine reported that 40% of medical school graduates intend to seek some form of student loan forgiveness.

Many doctors receive forgiveness from a variety of sources. These are a few of the loan forgiveness and assistance programs available for doctors:

National Health Service Corps (NHSC) Loan Repayment Program: Gives up to $50,000 to licensed health-care providers working for two years at an NHSC-approved site.

Students to Service Program: NHSC-sponsored program that awards up to $120,000 to students in their final year of medical school. They must commit to a three-year contract at an approved site.

Indian Health Services Loan Repayment Program: Repays up to $40,000 in medical school loans for health care professionals. Borrowers must commit to a two-year service contract in a facility that services serves American Indian or Alaska Native communities.

Beyond these options, you may also get loan assistance from your state. Many states offer significant aid to physicians who work for two to three years in critical shortage areas. The California State Loan Repayment Program, for instance, awards up to $110,000 to health care professionals working in underserved areas in the state.

3. Dentists

The average dental student graduates with over $247,000 in student loans. Even with the high median salary of nearly $160,000 a year, that’s a huge amount of debt to pay off.

Fortunately, many of the same loan assistance programs available to doctors also help dentists. You can search for loan assistance programs in your state, many of which offer aid to anyone in the health-care industry.

Plus, there are loan repayment programs specific to dentists, such as the Maine Dental Education Loan Forgiveness Program. It forgives 25% of awards up to $20,000 annually ($80,000 total) if you work in an eligible facility in an underserved area of Maine.

4. Pharmacists

After four years of schooling, pharmacists snag a hefty starting salary of around $122,000. If they work in a high-need area, they could also get significant loan forgiveness.

The Arizona State Loan Repayment Program, for example, provides up to $105,000 in student loan assistance to qualifying pharmacists. Look up your state to find loan forgiveness for pharmacists in your area.

5. Psychologists

If you’re a psychologist, you’re probably drawn to helping people. Thankfully, there’s also help for you in the form of student loan assistance. Many of the same loan repayment programs that help doctors and dentists also offer aid to psychologists.

The Colorado Health Service Corps, for instance, offers $50,000 to qualifying psychologists. And like many other professions, you could also qualify for PSLF if you work for a qualifying nonprofit organization.

6. Veterinarians

Several states in the country have significant need for veterinarians who work with certain animals. Meanwhile, the USDA Veterinary Medicine Loan Repayment Program pays $25,000 a year to vets who work in a designated shortage area for three years. Since it’s administered by the federal government, the USDA program is available to veterinarians across the U.S.

How you can get your student loans forgiven

While all of these careers command high salaries, they also require years of expensive higher education. Debt of this magnitude can get out of control as the interest piles up.

If you work in public service or a high-need area, however, you could qualify for significant student loan forgiveness or assistance. As each day goes by, you’ll develop your career while taking one step closer to financial freedom.

This article originally appeared on Credit.com.