Abhinaytrader you can do things in any order you want.
Changing the path that the webserver connects to Flarum is done by moving the files on the hosting to the desired locations, maybe changing the file structure if necessary: https://docs.flarum.org/install#customizing-paths
Once the files are at the desired place, you need to inform Flarum of the new publicly accessible URL by modifying config.php