The best way to prevent blood clots in the legs is to walk as soon as possible after surgery.