PaperMC
PaperMC (A fork of Spigot) comes with a built-in Anti-Xray. This Anti-Xray usually does the trick just fine. It is simple to setup and causes no lag for both the server and the client (unless you hide caves (air), which will be much laggier for the client). A great guide is shown here. Again, make sure that you do NOT addair to hidden-blocks.
Orebfuscator
If you’re stuck using Spigot for whatever reason, you should probably use Orebfuscator. It may also work well in junction with Paper’s Anti-Xray, as it can also hide containers better.:::note Orebfuscator does have a tendency to turn chests into dirt when server is laggy, this is a visual thing and doesn’t delete the contents of said chests :::