How can I minimize the risk of accidentally modifying the wrong database?
One thing I like to do in SSMS is to use Custom Colours when connecting to database.
So you choose a nice bright Red for Live databases, and a gentle blue or green for dev or test systems.
I used to use the inbuilt SSMS, but these days I prefer the SSMS Tools Addon Colour coding.



Or like this for SSMS Tools (A really nice addon, and I find the colour better when it's on top, rather than on the bottom like the built in on)