How to show with the help of diagrams that magnetic lines of force, whatever their origin have no divergence?
Divergence actually means how much a field line spreads. The electric field normally spreads all around hence positive divergence.
However the magnetic field line actually encloses in a closed loop path. So, if you take a particular region then the magnetic field going inward and outward would be the same(and that's what Gauss's law for magnetism says actually).
Meaning the net divergence and net convergence is equal which results zero divergence in other language net zero spreading around.
I would like to add up. Divergence means how much spread has occured in the field or in your case field lines. When you see that field lines are only emerging and spreading out, then you have a divergence. Electric charges follow this rule if they are isolated as you will see all lines coming out from the positive charge and until and unless there is a begative charge nearby, you will always see the lines spreading out from positive charge and not sinking anywhere.
Now comes what you asked, the case for magnetic field lines. You see there is another term convergence, which in other meaning means sinking/coming into or say meeting back. This can be seen for field lines coming into negative electric charge. So to show the magnetic field lines having zero divergence, you have to show that of you take a field line starting from a point and you take it point A, then you use the fact that the magnetic monopoles dont exist and there will be another point B. And meet all the lines here. So by this fact and diagram you show that the lines have a start so a divergence but they also sink at a point also so here the lines comverge. Hence there are no such lines that keep spreading and spreading out form a source.
Also as suggested in the comments, we know that magentic field exists in loop around the current carrying wire. Here also for the magnetic field you cannot determine a starting/originating pint and ending/sinking point of the field lines. So we see they do not keep spreading out and have zero divergence. And another 3rd diagram you can make is keep a magnet in a closed surface and make field lines coming out of the surface from the north pole and entering back into that surface only by the south pole. See there is no way that the lines have an exact source and keep spreading as the source is where they come back Hence the Gauss law says: The amount of magentic flux around a closed surface is always zero.
Hope you have understood it : )