Lamotrigine is an anticonvulsant medication primarily used to treat epilepsy and bipolar disorder. It works by stabilizing electrical activity in the brain, which helps prevent the abnormal firing of neurons that can lead to seizures or mood episodes.