Before we get into the very simple action of how to unenroll from Moodle, we must first touch on a limitation to this, and the reason for it. Because otherwise, this limitation will seem like artificially making this a complicated affair for one involved group of people, when in fact there is a good reason for it.
Students cannot, under normal settings, unenroll themselves from a Moodle course. It can be enabled, but it is strongly, strongly recommended by Moodle as well as by myself, not to enable this, for the very reason it’s not enabled by default.
This is a security risk, not just due to calamitous intent of others, but by mistakes from novice computer users nervously clicking buttons. Unenrollment wipes all the student records other than a note that they were there and then were removed, meaning that accidental unenrollment would result in total irrestorable loss of all data pertaining to this student, vis a vis, they would have to start over in light of an accident, unless a brand new backup has recently been made. These backups are an inconvenience to restore, and so, between convenience and security, it’s best to not let them have this capacity on their own, no matter how smart and trustworthy everyone is. Accidents happen.
So, when a student must be unenrolled, it’s very easy to do, and by the end if this paragraph, you’ll know how. First, go to “Users->Enrolled Users”, located in the “Settings” area of the course. From here, you may select a user by their checkbox, and remove them, confirming the removal after selecting it. This changes from version to version, so by the time you read this, it may say “Remove User”, “Delete User” or “Unenroll User”. They all mean the same thing, just know that depending on version and how much time has passed before you read this, this caption may vary.
So, this is how to unenroll from Moodle. A teacher or admin needs to be the one with the power to do it, not the student.