You first have to find them when you use the explorer kit and mine down there for shards.
You trade them for tms from a lady in pastoria
if you have to trade shards then trade Pokemon with people eqiupe it to a Pokemon your trading and theres shard trading make sure the other trainer has equiped a shard to the tradable Pokemon
Shards are different stons.
You trade them in a house left of pastoria city. She gives you the TMs Hail, Sunny Day, Rain Dance, and Sandstorm depending on the 10 Shards you give her. Nothing else.
Underground
yes
you can trade shards for stones in hunters house. His house is southwest of mossdeep.
In pearl? Well, you can go to the Route that's west of Pastoria City, and in the middle of the route (closer to Pastoria) you can find a house. In there a person will trade you A TM Rain Dance for 10 Blue Shards. In Platinum it's a move tutoring item, and in RSE you trade em in for Rain Dance TMs just East of Lilycove.
you get stones for shards from some persons house west of mossdeep
In HG/SS you trade Shards for Berries. Trade with Jugglers in Violet City and Fuchsia City.
Shards can be traded in for TMs at the rainy route near Soleacon Town.
find the guy who collects shards and trade shards for stones