Check if current user role is..

How to check if current user role is administrator or editor or author etc. below the function how I check it in wordpress.