A lifetime of wear and tear on your joints makes hip and knee pain almost inevitable. One in two adults will eventually develop knee pain caused by osteoarthritis, a condition marked by the gradual loss of the cartilage that cushions the ends of bones. One in four will develop hip pain from the condition.

Also inevitable: the quest to ease discomfort. Stores are full of over-the-counter drugs and supplements that, manufacturers claim, will provide relief. Doctors often recommend steroid injections or other shots, and hospitals tout the benefits of joint-replacement surgery.

Many of those measures can help, but some don’t. Some people rush to surgical options when simpler solutions would do the trick, while others put up with pain and disability far longer than necessary. Here is a guide to safely easing discomfort.  

For Mild Pain: OTC Drugs

When to consider: Anyone with joint pain should start with low-impact activities such as walking and swimming, combined with exercises to stretch and strengthen the legs. But you’ll probably need a pain reliever, too.

Consider acetaminophen (Tylenol and generic) first. When taken in recommended doses, it’s safer than other OTC pain relievers, such as ibuprofen (Advil or generic) and naproxen (Aleve and generic). Reserve those drugs, which ease pain and reduce inflammation, for flare-ups. 

You could also consider OTC creams containing capsaicin or methyl salicylate. Both stimulate nerves near the joint, creating a sensation that distracts you from the pain.

Stay-safe steps: The long-term use of acetaminophen can damage the liver, and frequent use of anti-inflammatories can cause stomach bleeding and increase the risk of high blood pressure, heart attack, and stroke. People who drink a lot of alcohol or those who have liver disease should avoid acetaminophen; those with heart disease should use anti-inflammatories sparingly. (Read more about the safe use of pain pills.)

For Lingering Pain: Injections

When to consider: If you have pain or disability despite taking OTC drugs, ask your doctor about injections with steroids (which ease inflammation) or hyaluronic acid (which lubricate the joint).

Stay-safe steps: Hyaluronic acid provides only modest relief, according to a 2015 review in the New England Journal of Medicine, and up to 3 percent of people getting the shots have side effects such as worsened inflammation of the knee. So use it only if you don’t improve with other options but aren’t ready for surgery.

For Severe Pain: Hip and Knee Replacement Surgery

When to consider: About 1 million Americans get a knee or hip replaced each year, and most say it helps a lot. Still, each is a major surgeries that, like all operations, poses risks of serious complications, including deadly infections, and recovery can take months. So make sure you have tried other solutions first, you understand the risks and recovery needed, and you choose your surgeon and hospital carefully.

Stay-safe steps: Look for a surgeon who does at least 50 of the surgeries per year, preferably 100. Ask about his or her complication and infection rates, and do some research. Two options for choosing a doctor: ProPublica’s surgeon tool and healthgrades.com. To compare hospitals, check our hospital Ratings for complication and infection rates. And if you live in California, use our California Healthcare Compare tool, which not only rates hospitals on the quality of care but also estimates your out-of-pocket costs for the procedure.

Be Wary of Joint Supplements

Despite their popularity, there’s little evidence that glucosamine and chondroitin supplements ease arthritis pain or improve joint function. That’s why the American College of Rheumatology says people should skip them.

In addition, supplements aren’t regulated as carefully as drugs, so you can’t be sure that what’s on the label is what’s in the bottle. If you want to give them a try anyway, stop after a few months if you don’t feel better. Avoid them entirely if you take the blood thinner warfarin (Coumadin and generic) because the supplements can intensify the effect of the drug.