because it was really hot today and then I started hearing thunder followed by lightning and started raining really heavy
then I thought how is it made ?
The exact method is not yet known, but a static charge builds up in the cloud(s) probably from friction between the particles of dust / water / ice that make up the cloud. When the electrical difference gets large enough with a nearby structure (A tree, a building, even another cloud) - ZZZAAAPPP. A lightning bolt forms as the charge bridges the gap (it can be as long as 10 miles!!) The lightning forms first and as it zaps through the air it super-heats it ,and the expansion of the air and subsequent crashing back is the thunder. You can not get the thunder first. If you think you do, you are hearing the thunder from an earlier flash, and then look up to see another bolt.
its static thats formed in the sky
how is it formed ?