Well, we wouldn’t die instantly. We already survive every day for 8-16 hours without the sun (depending on the season and location).
I’m assuming the intent here is to ask what would happen if the sun were to just suddenly cease to exist entirely.
In that case, it would take about 8 minutes for anything to happen to us, since the sun’s light and gravity both propagate at that speed. At that point, the Earth and moon would just continue on in a straight line, no longer in orbit around the sun. Losing the sun’s pull might have some nasty effects on plate tectonics, but I’m not sure about that.
The earth would slowly begin to cool. It wouldn’t be instantaneous; the atmosphere does a decent job of retaining heat for a time. How long you have here depends on the climate and season where you are. If it’s the dead of a snowy winter, temperatures would become nearly unbearable in 24-48 hours. If it’s summer, you might have several days.
This alone would do many people in. Soon, plants would die out, since there’d be no way to photosynthesize. Subsequently, the animals that eat those plants would die off. But with a few days to prepare, some might be able to make an artificial garden indoors and bring some animals in to shelter as well. Society at large would collapse, but some families and maybe even small towns could sustain themselves for a bit longer.
The big problem would be when it got so cold that the atmosphere itself starts to condense. At -183C, oxygen becomes a liquid. At -195C, nitrogen (78% of the atmosphere) also becomes a liquid. At that point, it would literally rain and then snow oxygen and nitrogen. (It’s theorized that this is what actually happens on Pluto; when it gets far away from the sun, its thin atmosphere falls as snow to the surface.) According to Michael Stevens of Vsauce, this would take about a year. So some individuals and communities with their own food and heat supply could presumably survive this long, as long as they didn’t venture outside after the first couple of weeks.
Then they would need to find some method of harvesting liquid and eventually solid oxygen for breathing. There’s a short story called “A Pail of Air” by Fritz Leiber that envisions this. If people could figure out within a year how to make this happen, then they could potentially survive for years, decades, centuries in a super-insulated, well-heated, and self-sustaining shelter. However, my guess is the average person would probably last a week to a month with no sun.
we have something which can make you understand. This image below was taken from www.thesolarcenter.co.uk