Ritalin is a prescription medication commonly used to treat attention deficit hyperactivity disorder (ADHD) and narcolepsy. It works by changing the amounts of certain natural substances in the brain. Methylphenidate belongs to a class of drugs known as stimulants. If you have any concerns about this medicine, ask your doctor or pharmacist.