Two suggestions that might help OP with some of these annoyances:
- See the "Turn off automatic switching" section of https://support.apple.com/en-us/HT212204, to take manual control of when they switch devices
- In System Preferences -> Notifications & Focus you can switch any apps notifications from "Alerts" to "Banners" which will make them go away automatically when ignored.