How to get the Role of a user not logged in?

How you can get the ID, if the USER is not logged in?
Where do you get the information from, taht the current USER is for example exactly → Mr.-X and not MRs.-Y ?

The user do not provide any information about him/herself, right?
-no email
-no slug
-no nickname
-no password

nothing —> because the user do not log in.

But maybe i understand something wrong.

Even if you are using your own custom DATBASE, how to determine, that the current loggend-in-user has a specific ID ?

I have already queried the site members database and got the ID I want

Where did you get the informations about the current user, navigating on your site?

So he has already loggen-in, giving you some informations about him/herself?