So I want to give access, with name A to K participants, can only access Time Management course. And then with name J to M can only access the work ethics course.
The first thing has came to my mind is to prepare a CSV file for creating this enrolments manually: https://docs.moodle.org/en/Bulk_enrolments (after first load, you'll need to add new users manually).
If you're planning to add more courses with this behaviour, I would recomend you to create cohorts instead and use the cohort sync enrolment method: https://docs.moodle.org/en/Cohorts#Adding_users_to_a_cohort_in_bulk
Hope this helps!