Tramadol is a prescription medication used to treat moderate to moderately severe pain. It works by affecting the brain's pain receptors and is often prescribed after surgery or for chronic pain conditions.