Charging by friction involves rubbing two different materials together that have different pulls towards electrons, so that one material will pull away electrons when the materials are separated and both will become charged. A common example of charging by friction is rubbing a balloon against hair.
When a material with a strong pull towards electrons (relatively), like rubber in a balloon, is rubbed against hair, it takes some of the hair's electrons. When the two are separated, the balloon is negatively charged due to the excess electrons, while the hair is positively charged. Moving the balloon close to the hair makes the hair stand up because the opposite charged objects are attracted.