Either by friction on a non-conductor, or by the influence of two conductors approaching each other. An insulator is often used as it is a simple way of doing it, and will hold the static and not simply conduct it away as it is generated.
Most friction-generated static requires a dry day, as moisture in the air will also bleed away the static.
See Wikipedia.org/whimshurst or Wikipedia.org/vandegraaf to see machines using the two basic types of generating static.
Chat with our AI personalities