You may want to get the role of a WordPress user by ID or even the role of the current user. First off, if you’re doing this for the current user, you can use the global $user_ID variable as the current user ID. Here is a quick function you can use to get the role