The database stores the data about the entered login, and you want to display. The next option:
$userlogin = CS50::query("SELECT username FROM users WHERE id = ?", $_SESSION["id"]);
With the subsequent conclusion:
<h4>Username: <?= $userlogin ?> </h4>
Causes the error:
Notice: Array to string conversion in
CS50::query - function to work with mysql in a cloud environment courses within which and pass this lesson.