There are many different ways to evolve Pokémon in Pokémon Brilliant Diamond and Shining Pearl. Typically evolution occurs by leveling up, but sometimes alternate methods are required. Some Pokémon can only evolve by being traded while holding a specific item. This is true of the King's Rock.
To get the King's Rock in Pokémon Brilliant Diamond and Shining Pearl, you will need to encounter a Poliwhirl as they have a chance to be holding one. Poliwhirl can be found on Routes 225, 226, 227, and 228. After acquiring National Pokédex, you can use it in the Grand Underground at the Fountainspring Cave, Grassland Cave, Riverbank Cave, Still-Water Cavern, and Sunlit Cavern.
You will need the King's Rock to evolve Poliwhirl into Politoad and Slowpoke into Slowking. These two Pokémon will evolve when holding a King's Rock. Just be sure to have them trade your new Pokémon back!
The other use of the King's Rock gives the Pokémon holding this item a chance to cause their opposing Pokémon to flinch after hitting it with an attack. But the primary purpose will be to evolve your Pokémon.
For more information on Pokémon, check out Where to find the Magmarizer in Pokémon Brilliant Diamond and Shining Pearl and All Grand Underground Pokémon in Brilliant Diamond and Shining Pearl on Pro Game Guides.