You can whitelist players by clicking on "Server" on the right of the Code Editor, then adding each player’s Minecraft username onto the whitelist in that window. You can have up to 25 friends on your server at the same time, but whitelist as many as you like 👍
If a friend tries to join your server and is not on the whitelist, you should also get a notification in the code editor - you can add the friend from the notification there and then.
If for some reason the username is not adding, it's likely because that username is not a valid Minecraft Java username. One quick way to verify this is by searching the name at https://namemc.com and if it says "available" (in green) then it's not valid.