How you turn PvP off depends on your Minecraft version. On newer versions PvP is a game rule. On older versions it's a setting in server.properties.
Run this in the console:
gamerule pvp falsegamerule pvp trueGame rules are saved with the world, so this stays after a restart. On Paper, Purpur and Spigot each world has its own game rules. Run the command in each world you want to change, or use a plugin.
server.properties and set pvp=false (off) or pvp=true (on).Not sure which applies? Run gamerule in the console and look for pvp in the list. If it's there, use the game rule.
For a PvP arena or a safe spawn, use a region plugin:
rg define spawn and rg flag spawn pvp deny. To turn PvP off everywhere except arenas, use rg flag __global__ pvp deny, then pvp allow on the arena regions.