If the sun went out, we would all eventually die, but what would kill us and how long would it take?
First, once the sun is extinguished, the temperature of the earth will eventually drop to somewhere around 10 degrees above absolute zero, give or take. Those who cannot protect themselves from the cold will die first. How fast the earth cools will vary dramatically.
The surface of the earth isn’t going to get super cold immediately, but it will be fast. I would guess that somewhere around the third day it’s going to start to be uncomfortable for anyone without a good heat source. After a week the average earth temperature will be freezing. 0 deg Celsius, 32 deg Fahrenheit. It will vary tremendously depending on where you live.
It will stay warmer longer near the oceans and get colder faster the farther you get from them and obviously what started out cold will just get colder. It will take 1–3 years for them to freeze over.
We can get by for months this way, as the earth slowly cools, but after a year the average surface temperature of the earth will be -73 degrees Celsius, -100 Fahrenheit. An awful lot of people will run out of food and water well before then though.
If you have a heat source you can survive much longer, but you’ll need food and water. Everyone who somehow managed to survive the cold but didn’t have an ongoing source of food and water will die when their food and water run out.
If someone lived near geothermal activity in a well insulated structure and managed to get both heat and electricity, (light) from it indefinitely and had a hydroponic farm, they could go on for 10 to 20 years before the oxygen started to get cold enough to turn to liquid and become rain made of oxygen, and then as it got progressively colder it would become snow.
Imagine going outside to get a pail of air to bring in and put over the fire so that it would warm up and you could breathe. So while earth still has plenty of oxygen, it’s not going to be in a form you can breathe. Let’s say that after about 30 years or so, everyone is dead.
There are microbes and other life at the bottom of the oceans by geothermal vents. They are too deep for the sun to reach them and use other means to survive. They will never notice the sun is missing and continue on as normal.