So I may or may not have created a command block that repeatedly kills the closest player on a minecraft realm. how do I fix this problem
To fix this problem, there are two solutions.
Load a backup of the world from before you placed the command block.
On the realms menu, next to your realm, click 'Configure Realm'. Under the world, click 'World Options', then turn 'Command Blocks' off. Join the realm, break the command block and then turn them back on again.