Filter users by roles
Have a look at the view People (User) view, which is located at relative path /admin/structure/views/view/user_admin_people.

This view has a User role exposed filter. You only need to implement the same filter in your view. 

You need to select the same filter in screenshot below.