The Grand Underground is a new addition to Pokemon Brilliant Diamond and Shining Pearl, and it has plenty of stuff to do. You can battle Pokemon in the caves, dig for shards and spheres to upgrade your mining tool, find rare Pokemon statues, and more. Unlike the original Underground in Sinnoh, this version of it is much bigger and can be entered at any time, even when you're outside in the open world. It also corresponds to your overworld map of the game, making it easier to figure out where you are on the grid.
The first time you enter the Grand Underground, an NPC called the Underground Man will greet you and explain how it works. He'll then give you an Explorer Kit, a key item that allows you to access the Grand Underground at any time. When you use the Explorer Kit, you'll teleport to an area of the Grand Underground that matches your location in the overworld.
Once you're in the Grand Underground, your Explorer Kit will let you see the full map and select different options like "Go Up" or "Close". Selecting Go Up will immediately return you to the surface in the same spot where you entered.
You can also exit the Grand Underground at any time by navigating to a gold sparkly spot on the map and pressing the R button. This will activate your radar and reveal where treasure is hidden in the tunnels. You can mine these spots for evolution stones, shards, plates, and fossils. These treasures will then add to your total collected in a meter beneath the Grand Underground mini-map.