I do not like unpacking an archive to find out what is inside. It makes a mess in the current folder, and with a big archive it takes a while.
tar -tf backup.tar.gz | head
tar -xf backup.tar.gz path/inside/config.yml -C /tmp
-t only lists the contents. GNU tar and bsdtar both work out the compression on their own when reading, so there is no z or j to remember. The second line takes out one file and puts it in /tmp with -C.
Caveat: the path must match the listing exactly, including any leading folder. With an archive from someone else, read the list first and look for absolute paths or ../ before you extract anything.
Further reading: GNU tar manual