Modafinil is a drug that helps you stay awake and is thought to raise dopamine levels in the brain. While the exact way it works is still not fully known, it is thought to involve stopping neurons from taking dopamine back up. Because of this, there is more dopamine in some parts of the brain...
Neurotransmitter dopamine is linked to many things, such as being awake, motivated, and rewarded. Modafinil improves awareness and brain function by changing the levels of dopamine.
One important thing to keep in mind is that Modafinil does affect dopamine, but not in the same way that other drugs do. This is one reason why Modafinil is thought to be less likely to be abused and have fewer side effects.