How to get user details by name

“Users” are basically “authors” in WordPress so those pages are available at example.com/author/{user-name}/ (with or without the trailing slash) and what you are looking for is actually to change the “author permalink base” for the URL rewrite. eg:

add_action( 'init', 'set_custom_author_base' );
function set_custom_author_base() {
    global $wp_rewrite;
    $wp_rewrite->author_base="user";
}

You can then add (or modify) an author.php template in your child theme directory to output what you would like to show of the user (but of course not sharing private user info in public URLs like this.)

Of course this is a simple example, it might be easier to do it with a plugin like this if you want to keep the /author/ for some roles but change it for others.