In order for the information in DNA to be used by the cell, it first has to be copied into a temporary, usable form. This process is known as transcription. During transcription, a section of DNA is used as a template to build a strand of RNA. That RNA can then be used to make a protein or serve another functional role in the cell.
Transcription begins with the binding of specific proteins to the DNA. These proteins help assemble the transcription machinery and control when and where a gene is turned on.
A particular type of transcription factors known as activators bind to the enhancer. These activators are often specific to certain cell types or only produced after a cell receives a specific signal, so they help determine when and where a gene is turned on. When activators bind to the enhancer, if the enhancer is a significant distance from the promoter, the DNA can loop so that the enhancer is brought closer to the gene’s promoter. This is known as enhancer looping (and can be seen in the picture).
The promoter is the region just before the coding part of the gene, and this is where general transcription factors bind. These help form the preinitiation complex, along with RNA Polymerase, and help RNA Polymerase to position at the promoter - commonly the TATA box (a consensus sequence of repeating T and A pairs - most commonly TATAAA - found in many eukaryotic genes).
The interaction between the activators and the preinitiation complex help to stabilize RNA Polymerase enough for it to bind at the promoter.
After RNA polymerase is properly positioned, it begins to move along the DNA and build the RNA molecule in the 5' to 3' direction.
Only one strand of DNA, called the template strand (or the "anti-sense" strand), is used - this is the 3' to 5' strand of DNA (with the 5' to 3' strand being known as the "coding" or "sense" strand). RNA polymerase reads this strand and adds complementary RNA nucleotides to form a new RNA molecule. Wherever the DNA has an adenine, the RNA will receive a uracil instead of a thymine. The strand grows in the 5' to 3' direction as RNA polymerase continues to move along the gene.
Eventually, RNA polymerase reaches a specific sequence in the DNA known as the terminator. This signals the end of transcription and results in the dissociation of RNA Polymerase from the DNA, and the production of our RNA sequence.
In eukaryotic cells, the RNA produced during transcription is not immediately ready to be used. Due to this, the mRNA is often referred to as "pre-mRNA." It has to be processed before it can leave the nucleus and be translated.
First, the RNA is modified at both ends. A modified guanine known as the 5' cap (also known as a GTP cap) is added to the beginning of the RNA. This helps protects the RNA from being broken down, and aids in ribosomal recognition. At the other end, a long chain of (typically 100-200) adenine nucleotides, called a poly-A tail, is added. This helps make the RNA more stable and aids in exporting it from the nucleus.
In addition, the RNA undergoes splicing. Most eukaryotic genes contain segments called introns that do not code for the final protein - it's like when you go to a recipe website and have to skip through the backstory about the chef first trying this meal at their grandma's summer cottage before you actually see the steps of what to make. These are removed from the RNA. The remaining parts, called exons, are joined together to form the final, mature mRNA. This is completed by snRNPs - RNA-protein complexes that combine with pre-mRNA to form a "spliceosome".
This edited version of the RNA is what will be used during translation to build a protein.
Sometimes, a single gene can be spliced in different ways to include or exclude certain exons. This process is known as alternative splicing, and it allows for multiple proteins to be produced from the same gene.