How to prevent Mac from changing the order of Desktops/Spaces
System Prefs > Mission Control
Uncheck Automatically rearrange Spaces based on most recent use.



This will fix the order of all your regular Spaces - but not Fullscreen spaces, which always go to the right of existing numbered Spaces.

From comments: Note this cannot fix the Mac confusing which external screen is which. That's not user-controlled at all, &amp; seems to occur mainly [though not always] when the external screens are identical.