Need help with setting up dev environment for ERPNext and understanding previous work

To setup a dev environment you will have to install frappe and ERPNext same versions as the one on the production environment.
If it is v11 then you’ll have to check which python version is being used by the virtual env.
If it is <v11 then you want python2.7; >v11 you want python3
You can do that by going in to the bench folder and run

env/bin/python -V

Follow this guide to install bench
After you have installed bench, you will have to initialize it.
While initializing specify which frappe version you want installed and which python version you want to be used by the venv.
Something like this

bench init frappe-bench --frappe-branch version-11 --python {/path/to/python-executable}

After that is done install same version of erpnext

bench get-app --branch version-11 erpnext

If it is >v11 just follow the guide to install frappe and ERPNext you’ll be fine.

The github repositories will probably have the customization written as a separate app. You will have to install those.

bench get-app http://path/to/git-repo

Create a mysql dump from production and restore on dev.

Write code, run tests, push to github, Pull to production

To understand how Frappe Framework
https://frappeframework.com/docs