OVERVIEW
By enabling user segment sync as an enrollment method, you can automatically enroll all members of a user segment in a course. If a user is added to the user segment, they are automatically enrolled in the course. If a user is removed from a user segment, they are automatically unenrolled. In other words, user segment sync synchronizes user segment membership with course enrollment.
SET UP YOUR USER SEGMENTS
ENABLE USER SEGMENT SYNC
Step 1: In the relevant course, click on "Enrollment methods."
Step 2: From the "Add method" drop-down list, select "User Segment Sync."
Step 3: Give your User segment sync (1) a custom name, (2) enable it by making sure it is "Active", (3) select the user segment you wish to sync, (4) select the default course role that will be assigned to all users enrolled via the user segment sync and (5) decide whether you want user segment members to be added to a course group and select that group.

Note: If you decide to add user segment member to a course group via the user segment sync, group membership will be synchronized with user segment membership. I.e. adding a user to the user segment will automatically add them to the course group and, conversely, removing a user from the user segment will remove them from the course group (you will not be able to manually remove these users from the course group in question).
Once you're happy, click on "Add method."
Step 4: Your user segment sync will now be displayed under "Enrollment methods." Ensure that the user segment sync is visible by checking that the "eye" icon (
) is completely open (if not, click on it to open).