This one is less of a newbie advice and more of a general thing: how to avoid your PvP defense team "randomly" switching. I was recently reminded this is still a thing, and it definitely falls under the label of something I "wish I knew" for the first couple months after the PvP patch.
In PvP, if you enter the battle prep screen (the screen where you can scout and see troop details), click Edit Teams, and then back all the way out without fighting, your defense team will be set to the last team you had selected from the Edit Teams menu (or the first team, if you collapse the list then exit). It doesn't matter if you actually change any of your teams or not, the glitch occurs if enter the Edit Teams screen from scouting screen, then back out of the scouting screen instead of proceeding into battle. You will also not be affected if you Edit Teams, then proceed into the battle without backing out of the scouting screen. This glitch does not affect using Edit Teams from anywhere else other than the PvP battle prep screen (explore, quests, and challenges are all safe to edit, then back out completely).