When I log in to my website, how do I retrieve the data of the logged in user?

When I log in to my web page, I can pull the id of the logged in user. For example, write the name and surname of the logged in user in the label, how can I retrieve this from the database?