Following a dozen knee surgeries over 30+ years, I actually had to have the right hip replaced first, January of last year followed by the left hip 9 months later...then, finally both knees @ the same time 3 months after the 2nd hip (11 months ago @ 60yoa). Spent 2 days post surgery in the hospital for each operation(s) and went to work...light duty, which involved flying cross country and back, 2 weeks later

. IMHO, knees are more painful than hips, but don't have the post op "you can really screw this up" issues that hips do.
Here's what worked, for me anyway...with the hips I only took advantage of the hard narcotic pain meds the night of the surgery...then got off 'em. With the knees, I took advantage of the same pain meds the night of the surgery AND the following day/night. Worked the hospital PT/OT HARD/OFTEN (even in bed, day and night worked the knees, bend/hold/stretch/hold/repeat...used the walker to walk the halls, again often...yes with butt hanging out

dragging the hat-rack with all the tubes/bags

) and I used the ICE machine as often as they'd let me...and then some

. It's a PITA to take off/on, but do so...BEND/STRETCH/WALK OFTEN. Started outpatient PT next day following discharge from hospital...and every other day thereafter. Both at OP PT and home PT, worked it HARD and OFTEN. MORE/FURTHER/HARDER worked for me

...
Best of luck...