Static electricity occurs when two or more bodies come into contact and separate again. This is a phenomenon between surfaces that results in the transfer of electrons from one atom to another. It can be generated as follows:
Electric charge by rubbing
Electric charge by induction