You need to visit a physiotherapy clinic to know proper excercise regime for both knees and shoulders.
Next Steps
At home you can do hot fomentation (garam sikai). Do regular excercise that physiotherapist will tell you.
Health Tips
avoid sitting with crossed legs.
move your shoulder to the full range ( as much as possible), so that it will not freeze.