It should go without saying that having a current backup of your computer is an essential preventative measure in case the worst happens. But there's another very simple step you can take that can potentially save you a lot of headache -- create a secondary administrator account. Make sure that account is pure and is in the default Mac or Windows configuration.
It's good to do this so that if you find yourself locked out of your normal profile, or if something goes wrong with it, you'll be able to sign into the other admin account and make changes to your primary account from there. It's also a good idea to give that account a different password from the primary one as well. If you're struggling to figure out what password to use that you won't forget, you can use your regular password spelled backwards.