Minecraft wiki entry for Griefing_prevention, associated text: Remember that the more people that know about your base, the more likely it is that it can be griefed due to people sharing the coordinates to a potential griefer.
Building far away from spawn will make your base harder to find. Also, do not build near any major roads or highways.
Making the base out of blast-resistant, nonflammable materials (such as concrete) will make your base tougher, though dedicated griefers will probably have enough explosives to do a sizable amount of damage.
Hidden, underground bases can be useful if you never want to be found.
If you see your base or another base being griefed, record the griefer and report it to the server owners.
Use ender chests. Ender chests, while expensive early on, have a different inventory for each player, meaning that no one else can access your ender chest. Storing items in shulker boxes and storing them in your ender chest will drastically increase your available inventory space.
Build in the nether.
To slow down hackers if you have an underground base, cover it in lava (make it look natural!) and limit how many storage items you have.
To combat a griefer, try adding traps to your base, and hide your chest of valubles.
Make your house look like a noobs'. Most griefers care about diamonds and other stuff, so make a 2" dirt house and just hide your good things underground.
Never be intimidated by a griefer's threats. If you see a griefing happen and the griefer tells you to stay shut, still tell the admins. The griefer will probably be banned, and even if they get payback, it's better that your diamonds are stolen then 20 players diamonds are stolen. Be considerate for your fellow players.