Also I would use Good Guardians app "Galaxy App Booster" quite regularly. I also every couple of weeks to a month remove all apps from 'Deep Sleeping' and 'Sleeping' in device care then install all available updates from Play Store and Galaxy Store as it seems when they are in this state many app don't get updated. If I get a lot of app updates at once I usually Use Galaxy App Booster again, if it's not needed it just churns through all the apps in about 45 seconds flat anyway so no harm doing it too often. Then throw in a soft reset now and again by holding down the volume down button and the power button until the phone screen turns off and resets. Other than changing animations to 0.5x in developer settings (which really only give the illusion of a snappier phone) that's pretty much all I do alongside cache partition reset every software update. Most recent update was 1st of January. Been getting great battery and no lagging for several months now from 12 / UI4.0, did however get lag and bad battery during the beta and definitely even more once it ended lol but I'm good now, hope you can resolve your issue.