Going into any surgery it is always beneficial to have full range of motion and being as strong as possible. It will be much easier to regain strength and range of motion if it is there prior to surgery.
Do you have a surgery date set? Perhaps ask your physician if they would prescribe physical therapy as pre-hab prior to surgery? Box squats, step ups, single leg balance, stiff legged deadlifts, glute raises, lateral mini band walks etc. are all good exercises to be doing. The depth of the box squats can be tailored based off your pain level to avoid aggravating your knee.
Good luck with your surgery and recovery!