CAR and SAR models are extensively discussed in the literature. For instance, you can learn more about CAR models by reading the two case studies linked to in ?cor_car and you can read more about spatial weights matrices used in SAR models under ?spdep::listw2mat.
Testing whether residual autocorrelation exists is possible by comparing the models with and without those autocorrelations using, for instance, loo().