To understand the Sun, you must understand the science behind it first. What is the Sun made of? How does it burn? Will it ever stop? These are questions scientists have been pondering for years. The first mistake, though, is that the Sun doesn’t particularly burn, it glows and produces radiation. The Sun is able to convert its gravity into energy, which is then used for heat and light. How it does this is through a process called nuclear fusion – the conversion of hydrogen to helium. Nuclear fusion starts at the atoms of these two elements, or more specifically, the particles. To understand this, though, you have to understand the basic structure of atoms. 

Every atom has a nucleus in the center made out of protons (with positive electrical charge) and neutrons (with no charge). Neutrons are used to glue protons together if the nucleus has more than one proton, since their positive electrical charge causes them to repel each other. However, electrons – the final building block of atoms – are the exact opposite of protons, with a negative electric charge instead of positive, and attract to protons instead of repel. So to prevent protons and electrons from crashing together, the electrons must spin quickly around the nucleus. 
An element is determined by the number of protons it has in its nucleus.
For example a helium atom has two protons and two neutrons – the neutrons purpose being to glue the other two protons together – completed by two circling electrons. A hydrogen atom, on the other hand, consists of only one proton in it’s nucleus, surrounded by one circling electron. 

This is where nuclear fusion comes in. Hydrogen gas found in the Sun is under a massive amount of pressure due to the enormous amount of heat and pressure from the gravity pressing against it. In fact, the pressure is so massive that it squeezes millions of groupings of four hydrogen nuclei at a time so much that they stick together to form one helium atom. Two of the four protons in each hydrogen nucleus are transformed into one nucleus as they fuse into helium, releasing their former energy out into their surroundings. Combined with the energy nuclear fusion already makes by forcing protons to crash into each other, this process results in making a massive amount of energy – equivalent to about a trillion megaton bombs a second! After creation, this mass of energy rises to the chromosphere (outer layer of the Sun), by taking the form of light and heat, that radiates out into our solar system, providing heat to our planet that’s essential to our survival.

Nuclear fusion isn’t only crucial to our existence but also to the Sun itself. Because of the Sun’s extensive mass, it’s gravity is very powerful. So powerful that the Sun’s gravity would have been the very reason for it’s immediate collapse on itself by now… if it wasn’t for nuclear fusion. This process makes so much energy that it pushes back against the gravity forces pressing against the Sun’s core. Even though both sides have immense power, the Sun’s battle for survival will not end for approximately 5 billion years. This is around the time that the Sun will run out of it’s hydrogen supply (that’s about halfway through, used up over the past 4.6 billion years) so it can’t fuse helium anymore. That doesn’t mean nuclear fusion will stop though, just that the Sun will start fusing bigger elements. As the Sun fuses bigger and bigger elements, it will start to expand gradually into a huge red giant, swallowing all planets in our solar system up to Venus. Until it starts fusing iron, this will continue to happen, but sadly nuclear fusion with iron is a star’s dead end – the point at which any elements larger are impossible to fuse. Then, and only then, will gravity finally win the seemingly endless battle, and, with no nuclear fusion energy to fight back, it will crush the Sun outside in. After the rapid collapse, and after a colourful planetary nebula, the remains of the Sun (a white dwarf) will continue to live for billions of years. Of course, with the extreme heat increase as a result of the Sun’s expanse, all human life on earth will be long gone by this point. But, don’t worry! This will not happen for another 3 billion years, and we will never experience anything like it in our lifetime.  
As for the Sun right now, all that the two extreme forces are doing currently is balancing each other out. If the energy level goes down in the Sun for a moment and gravity has the upper hand, all it will do is put more pressure on the hydrogen, resulting in more nuclear fusion and more energy to fight back on the gravity.

How does the Sun’s gravity work?
Throughout my life I’ve wondered and came out with lots of questions about the Sun. But, my main one?: Why do all the planets in out solar system rotate around it? If you’ve wondered the same, you’ve probably heard the same answer – gravity. But, what truly is gravity? What causes it, and why doesn’t it cause all planets to fall into the Sun? The answer lies in a term you’ve probably heard about, but don’t actually understand: spacetime. 
I’ll try to simplify my quick definition as much as I can, but you can never truly grasp the concept of spacetime with a simple explanation, considering that it is something even scientists don’t fully understand. We live in a 3 dimensional world, where depth, height, and width are the only dimensions, or so we think. Spacetime, something all around us, takes the three dimensions of space and the one dimension of time and fuses them together, resulting in 4 dimensional continuum. Keeping in mind that spacetime isn’t an actual object, just an invisible continuum, we are always traveling through it in a path called a world line. Every time you travel through space, you are traveling through time as well because it takes time to move. Even if an object is stationary, it’s still traveling through spacetime, because it may not be moving through space, but it’s still moving through time. Spacetime is usually thought to include the history (and even the future) of the entire universe, containing every “event” that ever happens, which includes everything’s world line in space time. This line can be represented in 2D like the graph below. 
Think of each horizontal line in this picture as a thin panel of where each object is at the moment. As the horizontal lines move up, the line either stays straight or slants diagonal, the angle depending on how fast each object is moving. Here’s where things get crazy. It is believed that we don’t move across our world lines, but that we are the world line. This concept introduces an unbelievable concept based on how our futures might already be invented. Before things get too complicated, let’s move on to how spacetime impacts gravity. Or should I say how spacetime creates it. Scientists usually visualize spacetime as a 2D sheet laid across space to help understand it’s effects on objects. Without any objects in space, spacetimes geometry would be perfectly straight. However, when we introduce masses like stars and planets to the equation, just like laying an object on a sheet, spacetime curves. The larger amount of mass, the more curvature, and more gravity around that object in space. Because of these curves, planet’s, satellite’s, and even star rotation happens around objects with great mass. These objects in spacetime always travel geodesic paths through spacetime. Take for example the moon. It takes the quickest path through space time, which would have been right past the earth if it wasn’t for the curvature. Instead the moon orbits the earth in line with the bends in spacetime. Near earth’s atmosphere, spacetime curves down, creating a downward acceleration force, otherwise known as gravity. The only reason the moon doesn’t fall into earth’s gravity is because of its velocity. Gravity’s force and the moon’s speed around earth balance each other out, resulting in a continuous circular orbit. This explanation stays the same while explaining the eight planets orbit around the Sun. It’s immense gravity due to it’s enormous mass, is always trying to draw planets into it. Instead, these planets orbit the Sun which is the compromise for the planets velocity forcing them forward , but the Sun’s gravity forcing them towards it. The planets circular motion allows them to continue moving sideways, but stick to the Sun in a circular motion around it.

The Sun’s magnetic field:
Electric currents produced below the surface of the Sun create a complex magnetic field that spreads beyond our own solar system and into interstellar space with the help of a the “solar wind” that the Sun creates. Just like the Earth’s magnetic field, the Sun’s magnetic field has two poles, although unlike it these two poles switch at the peak of the Sun’s magnetic field cycle called it’s solar cycle. Throughout eleven years the Sun’s magnetic field changes, due to different speeds of rotation of the Sun’s core and crust. Overtime, this uneven movement actually distorts and twists the Sun’s magnetic field, tangling it and bunching it up at certain points. Where the Sun’s magnetic field bunches up, sun spots form which are dark spots on the Sun. These spots are actually dark because they are about 1800°C colder than the rest of the Sun and produce less heat. This is because the bunches of magnetic field have so much magnetic power that they push back the hot gases beneath them and prevent the heat from rising directly to the surface. Sun spot clusters can be as large as Jupiter, and a singular one is usually about the size of Earth. 
Finally, after about six years, the magnetic field gets so twisted up that it “snaps” at places, causing solar flares which are huge explosions of energy and are the twisted magnetic field’s way of releasing it’s energy. CME’s (Coronal Mass Ejection’s) are another way the Sun releases energy. They too are caused by breakage in the magnetic field, but they are still different from solar flares. Instead of the magnetic energy travelling slowly and converting into thermal energy, the energy in a CME coverts into kinetic energy and travels fast and cool. At this point in the cycle the Sun’s magnetic field polarity flips. The magnetic field weakens, goes out completely and returns with opposite polarity. The amount of solar flares and sun spots slowly go down for the last five to six years as the Sun breaks more and more of it’s twisted magnetic field. In this way, it can clean out the old magnetic field and make a new one, coming back to the start of the cycle. At last the Sun has finished it’s cycle, just to repeat it through the next 5 billion years again and again. 
Although this whole cycle might be harsh, one of it’s effects on Earth are actually quite enjoyable. Aurora Borealis happens as a result of this cycle when the solar wind (a stream of charged particles released from the Corona of the Sun) carries deadly charged particles on the path to Earth. These particles take on average three days to get to earth and can travel up to a million miles an hour. Instead of hitting the Earth, these particles are deflected by Earth’s own magnetic field. But, since the magnetic field goes in and gets weaker at it’s two poles, some particles are able to enter Earth’s atmosphere at the south and north hemisphere. Before the charged particles can hit the ground, they are stopped when they collide with the atmosphere’s gas particles. These particles, all being electrons, impart energy to oxygen and nitrogen molecules, making them “excited”. As the particles calm down they release photons, which is energy in the form of light.
The colour of the light released depends on the kind of gas molecules, their electrical state at the time of collision, and the type of the solar wind particles they collide with. For example, oxygen about 60 miles up releases a common greenish-yellow colour, while oxygen 200 miles up releases a rare red colour. Purplish-red is another common colour in auroras, emitted by nitrogen gases about 100 miles in the sky. Because of the enormous amount of photons being emitted, these colours are visible to the human eye. Northern lights can only be seen at night, though, because the Sun’s light overpowers them at day.
CME’s also can cause more negative effect’s on Earth too. For example, a geomagnetic storm can happen, which is when the Sun produces such a large and powerful CME that it causes a temporary disturbance in the Earth’s magnetic field. This could result in a electrical power blackout, disturbances in radio communication, of satellite drags.

The beginning – how was the Sun created?
Like all stars, the Sun was created in a unique process in space called a Planetary Nebula. Believe it or not 4.6 billion years ago the Sun was nothing more than a huge cloud of mostly hydrogen and some helium. The first step to this gas cloud becoming the Sun started when the gas particles started to collapse on each other due to the gravity force of all of them combined. The outside particles combined to form a circular disc around the more dense area of matter called a protostar.
The protostar didn’t last long though, because the forces of gravity were still working against it. It continued to compact the protostar smaller and smaller, until the gases inside couldn’t stand the pressure anymore. Hydrogen atoms got fused together and nuclear fusion began (see “Nuclear Fusion” below to understand). Nuclear fusion had managed to produce enough energy to counterbalance the gravity force pressing back – for then. At this time the protostar was about 50 million years old. The protostar was gradually getting closer to the amount of temperature and pressure for a nuclear fusion reaction to occur.