This is called as trigger thumb and occurs commonly in diabetic and osteoarthritis. Following is the treatment;
1) oral nonsteroidal anti-inflammatory drugs,
2) steroid injection/shot at the site of trigger,
4) Physical therapy
If these measures fail, surgery may be resorted. Read about it in details in this resource;
Please feel free for your follow up questions.