Private servers: whitelist first
If the server is for friends, turn the whitelist on and keep online-mode enabled. That alone stops random players and bots from ever getting in. Most griefing on small servers comes from strangers who found the address on a scanner or a shared link.
Public servers: protection in layers
- Land claims, such as GriefPrevention, so players protect their own builds
- WorldGuard regions for spawn and shared areas
- CoreProtect logging so every change can be traced and undone
- Sensible permissions: new players get basic commands only
- An anti-cheat for flying, x-ray and speed hacks
Close the less obvious holes
Lava, fire and TNT are classic griefing tools; limit fire spread and TNT in protected areas. Watch for griefers stealing from unlocked chests in shared spaces, and use containertrust carefully. Paper's anti-xray engine makes ore hunting with x-ray packs much harder.
Do not hand out operator status, and be careful who gets staff permissions: a surprising amount of griefing is done by trusted players with too much access.
After a griefing attack
Ban the player first, then use CoreProtect to look up everything they did and roll it back. For widespread damage, restore a backup, but remember that a full restore also undoes everyone else's work since then. Tell your community what happened and what you fixed.