To configure the lag order for ARCH and GARCH models, use the squared residuals of the time series trained to predict the mean of the original series. The residuals are zero-centered so that their squares are also the variance. Then inspect the ACF and PACF plots of the squared residuals to identify autocorrelation patterns in the variance of the time series.