As someone who is over a decade out of a successfully rebuilt shoulder (meaning that I recovered to full function from being a college athete and water polo player who thoroughly abused my shoulders, and am single arm pressing 54lb kettlebells for reps no problem now, along with every other atcivity that I was able to do prior, except for swimming freestyle for distance) here's what I followed following surgery: I rested that arm and did nothing for 6 weeks, and then did my PT every day and was in the PT office 2-3x a week for 12 months... I then was doing daily PT exercises and a 1x a week office visit for PT until the 18th month of surgery. I probably continued my daily PT exercises until month 24 or 30 on my own as well...
To say that the PT is agony for shoulders is an understatement. If you have a good physical therapist, they will push you, and you'll feel every fraction of a degree of motion that you're trying to get out of your shoulder. Having someone who will hold you accountable for your daily PT and range of motion exercises is important because you're not going to want to do daily PT unless you're a masochist.
Investing in PT (but not overdoing it) is the key, along with eating healthy and knowing when not to push yourself to or past your breaking point. If anything, focusing on the recovery portion and allowing myself time to rest probably helped me return to full motion faster, and when I finally started using my shoulders again during workouts, I focused on full range of motion, dynamic movements, and proper form with reasonable weights and attainable goals. I reset my performance baseline entirely and ate the humble pie to do so, which was an ego-killer initially, but by month 24, I was pound-for pound stronger, faster, and more resilient than I ever was before, and never looked back. I attribute a lot of this to focusing on whole body lifts and not doing stupid things that would get me injured again... and being patient.
TLDR: Don't skimp on PT, be patient, and recover properly. Also know that your entire musculature on that side (chest, back, arm, and neck) will be affected by atrophe post-surgery, which is ok, but your baseline will change and need to be rebuilt.