Thanks for the question. The Discover tool may be a good fit for your use case. It allows users to search for active courses and self-enroll. In addition, learners can self-unenroll from the courses they self-enrolled in.
You can set enrollment rules like this-
You can read more about this here-