Electrodes are applied to the scalp to record electrical activity in the brain through an electroencephalogram, or EEG. By analysing the electrical patterns and irregularities in the brain, it aids in the diagnosis of illnesses such as epilepsy, sleep problems, and brain tumours.