In a magnetic field, if the lines of the magnetic field are parallel, the strength of the magnetic field at any point will be the same means the field strength will remain uniform.
By preparing a comparatively long cylindrical coil we can generate a uniform magnetic field.
Non-uniform magnetic field:
If the magnetic field lines in a particular magnetic field range are not uniform, the field at all the points is non-uniform.
The magnetic field generated due to a bar magnet is non-uniform.