The approach you're following is in essence close to the well-known Box-Jenkins method.
Basically, in the identification part of the methodology, it tells you to analyse the ACF and PACF of a time series in order to determine whether you should differentiate it (both for trend and seasonal components) and which lag-orders you should specify for the moving average and autoregressive components.
For the autoregressive part, quoting wiki:
Specifically, for an AR(1) process, the sample autocorrelation
function should have an exponentially decreasing appearance.
For the moving average part, also quoting wiki:
The autocorrelation function of a MA(q) process becomes zero at lag q
+ 1 and greater, so we examine the sample autocorrelation function to see where it essentially becomes zero.
This post has a nice intro on how to approach forecasting time series using the Box-Jenkins method.
Note: using the random part of the decomposed series, you're just using the original series subtracted from its linear trend and cyclical component, but you need to validate whether this is the right way to make your series stationary. This can be achieved, for example, using the ADF test, also covered in the post I pointed to.