If you're going for surgery, you'll be a given a list of exercises to do while in hospital and at home.
Initially, it'll be as simple as wiggling your toes and breathing deeply. As the days progress, you'll be given more things to do, but not more than you can handle.
Although you may not feel like it, just do it anyway!
The exercises will help to prevent blood clots and will also speed you along on the road to recovery.