You can unenrol yourself from course by selecting More menu -> Unenrol me from XXX.
You will see an confirmation box that you have to click "Continue" on to complete the unenrolment. If you do not wish to unenrol from the course you can click "Cancel".
Important
Do not unenrol yourself from the course if you have not completed the course and received the grades to your own study register or received an certificate (or other proof of completion). When you unenrol yourself, teachers aren't able to see your work on the course anymore.