We have investigated the basic statistics of the cosmological dispersion measure (DM) -- such as its mean, variance, probability distribution, angular power spectrum and correlation function -- using the state-of-the-art hydrodynamic simulations, IllustrisTNG300, for the fast radio burst (FRB) cosmology. To model the DM statistics, we first measured the free-electron abundance and the power spectrum of its spatial fluctuations. The free-electron power spectrum turns out to be consistent with the dark matter power spectrum at large scales, but it is strongly damped at small scales ($lesssim 1$Mpc) owing to the stellar and active galactic nucleus feedback. The free-electron power spectrum is well modelled using a scale-dependent bias factor (the ratio of its fluctuation amplitude to that of the dark matter). We provide analytical fitting functions for the free-electron abundance and its bias factor. We next constructed mock sky maps of the DM by performing standard ray-tracing simulations with the TNG300 data. The DM statistics are calculated analytically from the fitting functions of the free-electron distribution, which agree well with the simulation results measured from the mock maps. We have also obtained the probability distribution of source redshift for a given DM, which helps in identifying the host galaxies of FRBs from the measured DMs. The angular two-point correlation function of the DM is described by a simple power law, $xi(theta) approx 2400 (theta/{rm deg})^{-1} , {rm pc}^2 , {rm cm}^{-6}$, which we anticipate will be confirmed by future observations when thousands of FRBs are available.