Hi Abu,
Check out these threads :
https://moodle.org/mod/forum/discuss.php?d=194883
https://moodle.org/mod/forum/discuss.php?d=210828
Also check this Bulk Unenrollment process : https://docs.moodle.org/34/en/Unenrolment#Bulk_unenrolment
I hope this will help