How to prevent Spaces from rearranging in macOS
If you use Spaces or Virtual Desktops in macOS then you'll notice that their arrangements often times change. This is because macOS by default sets to automatically rearrange Spaces by recent use. While this could be useful to some, it could get frustrating if it disrupts your workflow.
You can prevent macOS desktops from changing orders by setting it up from Mission Control's preferences.
Steps to prevent Spaces from rearranging in macOS:
Open System Preferences from the Apple menu.
Click on Mission Control.
Notice that Automatically rearrange Spaces based on most recent use is enabled.
Untick the checkbox for the option, and your Virtual Desktops / Spaces should no longer re-arrange by itself.