First check the type of compression using the file
command:
file name_name.tgz
O/P- If output is " XZ compressed data"
Then use tar xf <archive name>
to unzip the file, e.g.
tar xf archive.tar.xz
tar xf archive.tar.gz
tar xf archive.tar
tar xf archive.tgz