Whitelist and operators
The whitelist decides who can join. Once it's on, only players on the list get in. Operators, or ops, are players who can use admin commands in the game, such as changing the game mode or kicking players.
Java servers keep both lists in the main folder, in whitelist.json and ops.json.
Use console commands
The console is the easiest way, because the server looks up each player for you.
whitelist on whitelist add PlayerName whitelist remove PlayerName whitelist list op PlayerName deop PlayerName
Type them in Console as they are, or in the game with a slash in front once you're an operator.
Watch out: The preview console answers a short list of commands, so these reply with Unknown command for now. They work on a real Minecraft server.
Edit the files instead
You can edit the lists in Files too. Each entry needs the player's UUID as well as their name, so this way takes more care. Stop the server first, save your changes, then start it again.
[
{ "uuid": "the-player-uuid", "name": "PlayerName" }
]The whitelist setting lives in server.properties. enforce-whitelist also kicks anyone online who isn't on the list.
white-list=true enforce-whitelist=true
Bedrock servers
Bedrock servers use allowlist.json and permissions.json instead. Turn the list on with allow-list=true in server.properties, and add players with allowlist add in the console.