A lawyer refers to anyone who has been formally educated in the field of law but has not yet passed the bar exam. An attorney has been trained in law, has passed the bar exam, and has been licensed to practice law in states where they hold a license. Attorneys can legally represent clients in court, whereas lawyers cannot.