The procedure is quite simple: the symmetry factor counts how many of the same diagrams you would be counting if you didn't consider that the single particles in your diagrams are identical. To do this, ask yourself "how many of this same diagram can I make?" where "same diagram" means "same external particles, same connections, and same vertices". To do this you want to
- draw only the external particles and the vertices, leaving other particle lines "unconnected"
- pick one of the unconnected lines: in how many ways can you connect it so that you have the desired diagram? Count them, and then connect it in one of the ways you just found (doesn't matter which one)
- continue for the other unconnected lines, minding that now some of the earlier possible connections will be "taken"
- the product of all the numbers you found is your symmetry factor, and its inverse is to be multiplied by your diagram in the perturbation series
To work with your example in $\lambda\phi^4$ theory:
- external particles and vertices drawn
- I picked the upper left line, and to make the desired diagram I can connect it either in the blue or orange way: so my number is two, and I write it down. Now I pick the blue connection (but I could've picked the orange)
- now I move on to the lower left line, but there is only one possible connection to be drawn: the green one, so I write one
- the symmetry factor is therefore $2\times 1=2$
Or yet another example:
- external particles and vertices drawn
- I picked the upper left line, and to make the desired diagram I can connect it either in the blue, orange, or green way: so my number is three, and I write it down. Now I pick the blue connection (but I could've picked the orange or green)
- now I move on to the center left line, but there are two possible connections to be drawn, so I write two
- ...
- the symmetry factor is therefore $3\times 2 \times 1=3!=6$