A .tar.gz file is an archive, or collection, of files stuffed together. It's very similar to a Windows ZIP file. Tar stands for "tape archive": It was originally used to store files on tape, back when hard drive storage was crazy expensive. The gz is for gzip which makes the file smaller.
You can use this web site to open tar and tar.gz files as long as they're under 10MB. For larger files, you'll need a utility on your computer.
Tar files are commonly used on the Ubuntu Linux system, so Windows cannot open them without a special program called WinRAR. You can also use other programs like 7-zip, but WinRAR is the easiest to use.
You should be able to double-click a .tar or a .tar.gz file on your Mac to uncompress it without special software.
If that doesn't work you can use Keka to open .tar files on a Mac. Once you install Keka, you can extract .tar archive files on a Mac.