Varenicline works by tackling nicotine cravings and also helps with withdrawal symptoms, such as irritability and trouble sleeping.