Diamagnetism and paramagnetism are two types of magnetic properties that materials can exhibit when placed within a magnetic field/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Magnetic_Properties).
Diamagnetism is an inherent property of all materials, and it arises from Lenzs laws. Diamagnetic materials are weakly repelled by magnets. When a diamagnetic material is placed in a magnetic field, the magnetic forces of the materials electrons will be affected in such a way that the material will be repelled by the magnetic field.
Paramagnetism is seen in materials whose atoms have at least one unpaired electron. Paramagnetic materials are weakly attracted by magnets. When a paramagnetic material is placed in a magnetic field, the magnetic forces of the materials electrons will be affected in such a way that the material will be attracted to the magnetic field/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Magnetic_Properties).
To determine whether a substance is paramagnetic or diamagnetic, we can examine its electron configuration. If the substance has unpaired electrons, then it is paramagnetic. If all electrons are paired, then the substance is diamagnetic/Physical_Properties_of_Matter/Atomic_and_Molecular_Properties/Magnetic_Properties).