Step 1: write the configuration of element and then show the valence elactrons around the symbol of element .
Step2: make the bonds around the atom according to its valency and use the electrons for making the bonds.
Step3: Now see if there are any unshared electrons pairs.
These are your lone pairs.
See the picture, examples depict the lone pairs of oxygen and nitrogen. Here are some examples: Ammonia and Water molecules , in ammonia Nitrogen is having one lone pair and in water Oxygen atom is having two lone pairs respectively.