When someone says “TG,” they are saying “Thank God.” It’s like someone saying they are feeling alleviated. When we think of having a “sigh of relief,” this would be a very similar expression.
Someone might say, “TG that just happened, I didn’t think that would occur!”