When diamagnetic compounds are exposed to an external magnetic field, they exhibit negative magnetization. As a result, magnets resist diamagnetic substances. In the direction of the applied field, paramagnetic substances gain a modest net magnetic moment. As a result, the magnetic field attracts them slightly.
The magnetic field significantly attracts ferromagnetic materials. Even after the magnetic field is removed, these materials retain their magnetism. Hysteresis is the lag of magnetization of a ferromagnetic substance behind the magnetic field.
Therefore,
The electrical configuration of the substance determines its magnetic characteristics.
A diamagnetic material is one in which all of the electrons in the substance are coupled.
If the substance contains unpaired electrons, it is a paramagnetic substance.
If the atoms have a net magnetic moment, the paramagnetism that results outweighs the diamagnetism. Whether en long-range ordering of atomic magnetic moments yields ferromagnetism and diamagnetism is likewise overpowered.
Paramagnetism's strength is proportional to the strength of the applied magnetic field. Electron orbits form current loops, which produce a magnetic field and contribute a magnetic moment, resulting in paramagnetism. The magnetic moments of electrons do not cancel out in paramagnetic materials.
Hence, this is the way to know if paramagnetic or diamagnetic.