Of course, the main issue is for the t statistic to have
a t distribution with the appropriate degrees of freedom.
For normal data $\bar X$ and $S$ are stochastically independent. (One might argue that they
are not functionally independent because $S^2$ can be defined in terms of $\bar X.)$
By contrast, for exponential data $\bar X$ and $S$ are not independent.
So, technically, it not enough for $n$ to be large
enough that $\bar X$ is nearly normal. In order for the distribution of a t statistic, e.g, $T = \frac{\bar X-\mu_0}{S/\sqrt{n}},$ to have
the appropriate t distribution, its numerator and denominator should be independent.
Using goodness-of-fit tests to check data for normality
before doing a t test has been deprecated. But it is
a good idea to look at plots of the data to see if they are nearly symmetrical and free of far outliers in either direction before using the data for a t test.
For example, consider a sample of size $n = 100$ from a Pareto distribution with minimum value $1$ and shape parameter $\alpha = 10,$ and mean $\mu = 10/9.$ [Observations can be sampled as
$e^Y,$ where $Y\sim\mathsf{Exp}(\mathrm{rate}=10).]$
Each row of the matrix MAT
below contains such a sample.
set.seed(2022)
m = 10^4; n = 100
MAT = matrix(exp(rexp(m*n, 10)), nrow=m)
A boxplot of the first sample shows marked right-skewness and outliers.
boxplot(MAT[1,], horizontal=T, col="skyblue2")
a = rowMeans(MAT)
s = apply(MAT,1,sd)
cor(a, s)
[1] 0.7201542
Sample means and SDs are clearly correlated.
But one might consider that the means $\bar X$ (a
in the code) are "close enough" to normal.
hist(a, prob=T, br=30, col="skyblue2")
curve(dnorm(x,mean(a), sd(a)), add=T, col="red", lwd=2)
However, $T$ statistics are not distributed as $\mathsf{T}(\nu=99)$---especially not in the tails,
where values are used to decide whether to reject the null hypothesis. So one should not trust results of a
t test on such Pareto data.
t = (a - 10/9)/(s/sqrt(n))
hist(t, prob=T, br=30, col="skyblue2")
curve(dt(x,n-1), add=T, lwd=2, col="red")
By contrast, samples of size $n = 50$ from a
standard uniform distribution behave well.
set.seed(129)
m = 10^4; n = 50
MAT = matrix(runif(m*n), nrow=m)
a = rowMeans(MAT); s = apply(MAT,1,sd)
cor(a, s)
[1] -0.01452768 # nearly independent
$T$ statistics are nearly distributed as $\mathsf{T}(\nu=49).$ So one could trust results of a
t test on such uniform data.
t = (a - 1/2)/(s/sqrt(50))
hist(t, prob=T, br=20, col="skyblue2")
curve(dt(x,49), add=T, col="red")