The EEG is a machine to measure brain waves. It’s mainly used to diagnose if somebody has had seizures (Epilepsy), and what kind of seizures they might be. It’s not at all uncomfortable.
Sticky electrodes are placed on a person’s head, and a tracing is recorded (done with needles in the old days, but no more). The test can be more accurate if the person is sleep-deprived. Sometimes strobe lights and other accessories are used to stimulate brain areas that might generate seizures. In rare cases when certain types of seizures are very frequent, but come from deep locations, it may be necessary to surgically place an electrode into the brain to obtain a closer recording.
EEGs can often detect abnormalities when a person feels well, but sometimes not. However, the EEG is always diagnostic during a seizure. Ambulatory (portable) EEGs may be used to obtain recordings over several days. In cases that are difficult to diagnose and also disabling, a person may be admitted to a hospital for several days for a continuous EEG with simultaneous video-recording, to really understand what’s going on. Interestingly, up to 40% of such patients’ abnormal spells are ultimately diagnosed as psychiatric illness, and not have epilepsy.