There are many ways to create a virtual environment in Python 3. Some use virtualenv, some use pyenv and some use poetry package. I think following is the easiest one.
I'm assuming that you're using Debian or Ubuntu or one of many Ubuntu-based Linux distribution and you are familiar with command line.
Install python3-venv package using apt.
sudo apt install python3-venv
Create a new directory which will house your virtual environment and your project and go into it.
mkdir foo && cd foo
Create a virtual environment called project_env.
python3 -m venv project_env
Activate the virtual environment you just created.
source project_env/bin/activate
Upgrade pip package.
pip install -U pip
If you have a requirements.txt file of your project, copy that into the project directory. Now you can install packages listed in requirements.txt by executing following command.
pip install -r requirements.txt
And when you finish working on the project, execute following command to deactivate the virtual environment.
deactivate