Go through this Manual to Understand the Installation Process →
https://heasarc.gsfc.nasa.gov/docs/software/heasoft/linux.html#source
https://heasarc.gsfc.nasa.gov/docs/software/lheasoft/download.html
You can untar the HEASoft source in any directory where you have write permissions. A clean and recommended location is inside your home directory, for example:
mkdir -p $HOME/softwares
cd $HOME/softwares
Now move the downloaded HEASoft source .tar.gz file here (software folder) if it's not already in this folder.
Assuming your downloaded file is named like heasoft-6.34src.tar.gz, run:
tar -xzf heasoft-6.34src.tar.gz
This will extract the source into a directory like heasoft-6.34/.
Now change into that directory:
cd heasoft-6.34