It depends on several things. Have you been treated in any way yet? Anti-inflammatory drugs and conservative treatment with physical therapy may be able to get your symptoms under control and restore your motion.
Has your doctor taken X-rays and/or MRIs to see what's going on in the joint? The condition of the joint and size of the joint space will help the doctor decide the best course of action.
Patients have more options now with the use of arthroscopic surgery. The joint can be scraped smooth of any torn cartilage or rough edges of bone. This is called debridement. Soft tissues such as the joint capsule or muscles can be released (cut)to help patients regain lost motion.
A joint replacement is an option but most doctors will try more conservative treatment first.