How to get the role id from the role name?

Try buildin function get_users. The code should be like that:

$args = array(
    'role' => 'editor'
);
$editors = get_users($args);
foreach ($editors as $user) {
    echo '<li>' . $user->ID . '</li>';
}

techhipbettruvabetnorabahisbahis forumutaraftarium24eduedusedusedueduseduedusedueduedus