A theory is developed for the calculation of the distribution function of random fields for classical simple magnets (Ising, XY, and Heisenberg) in D(=1,2,3) dimensions. The zero-field, muon-spin-relaxation functions for these simple magnetic systems are calculated with the distribution function of random field. The relaxation functions G(t) are different from the prediction of the Kubo-Toyabe theory, except for three-dimensional Heisenberg system. The long-time limit G(\ensuremath{\infty})=G(t\ensuremath{\rightarrow}\ensuremath{\infty}) is 0 for the Ising magnet in 1, 2, and 3 dimensions. For the XY magnet, G(\ensuremath{\infty})=0.5 for D=1 and 2, but G(\ensuremath{\infty})=0.356 for D=3. For the Heisenberg magnet, G(\ensuremath{\infty})=0.1168, 0.4608, and (1/3) for D=1, 2, and 3. For Ising magnets, there are oscillations in G(t) when the magnetization is nonzero. The effects of vortices as extra magnetic sources in the two-dimensional XY model are addressed and the possibility of detecting the Kosterlitz-Thouless transition by use of the zero-field, muon-spin-relaxation technique is suggested. The theoretical predictions are calculated numerically. The limitations, extensions of the formalism, as well as the applications of the theory to real magnetic systems, are discussed.