We present a novel approach for probing the microstructure of a thermodynamic system that combines thermodynamic phase transitions with the Ruppeiner scalar curvature. Originally considered for van der Waals fluids and charged black holes [Phys. Rev. Lett. 123, 071103 (2019)], we extend and generalize our approach to higher-dimensional charged AdS black holes. Beginning with thermodynamic fluctuations, we construct the line element of the Ruppeiner geometry and obtain a universal formula for the scalar curvature R. We first review the thermodynamics of a van der Waals fluid and calculate the coexistence and spinodal curves. From this we are able to clearly display the phase diagram. Notwithstanding the invalidity of the equation of state in the coexistence phase regions, we find that the scalar curvature is always negative for the van der Waals fluid, indicating that attractive interactions dominate amongst the fluid microstructures. Along the coexistence curve, the scalar curvature R decreases with temperature, and goes to negative infinity at a critical temperature. We then numerically study the critical phenomena associated with the scalar curvature, and find that the critical exponent is 2, and that R(1 −T ) 2 C v ≈ 1/8, whereT and C v are the respective reduced temperature and heat capacity. We next consider four-dimensional charged AdS black holes. Vanishing of the heat capacity at constant volume yields a divergent scalar curvature. In order to extract the corresponding information, we define a new scalar curvature that has behaviour similar to that of a van der Waals fluid. We analytically confirm that at the critical point of the small/large black hole phase transition, the scalar curvature has a critical exponent 2, and R(1 −T ) 2 C v = 1/8, the same as that of a van der Waals fluid. However we also find a significant distinction: the scalar curvature can be positive for the small charged AdS black hole, implying that repulsive interactions dominate among the black hole microstructures. We then generalize our study to higher-dimensional charged AdS black holes, and investigate the influence of the dimensionality on the black hole microstructures and the scalar curvature. Our novel approach provides a universal way for probing the microstructure of charged AdS black holes from a geometric construction.