Minecraft wiki entry for experience, associated text: To display Steve's current level: experience query Steve levels‌[Java Edition only]
To give 7 experience to yourself: xp 7‌[Bedrock Edition only] or experience add @s 7‌[Java Edition only]
To give 3 levels to Alice: xp 3L Alice‌[Bedrock Edition only] or xp add Alice 3 levels‌[Java Edition only]
To remove all levels from all players: xp -2147483648L @a‌[Bedrock Edition only] or xp set @a 0‌[Java Edition only] or xp set @a 0 levels‌[Java Edition only]