The Pokérus, short for Pokémon virus is an infection that can infect any Pokémon in your team. It is beneficial, and the Pokémon with the virus will get twice as many EV from fighting other Pokémon, so it is great for making a Pokémon ready for competitive play.
There is no direct method to get the Pokérus in Pokémon Brilliant Diamond and Shining Pearl, but it is rather a random chance. Each time you defeat a wild Pokémon, you have a 1 / 21,845 chance of being infected with the Pokérus. This means that is is completely random, and that it is extremely rare.
When you get an infected Pokémon, it can spread the virus to other Pokémon in the party. This allows you to spread it to the Pokémons that you want to use competitively.
The virus will be cured after 1 - 4 days by itself, but you can put the Pokémon in a box in order to stop the timer.