This page explains how to make your Pokémon follow behind you.
A new feature in Brilliant Diamond and Shining Pearl is the ability to have your first Pokémon follow you, as you journey across Sinnoh. Well, “new” compared to the original Diamond and Pearl anyway; this feature already existed in HeartGold and SoulSilver, Let’s Go Pikachu and Eevee, etc.
To activate this feature, you must visit Amity Square.
Where is Amity Square?
Amity Square is located along the north side of Hearthome City, near the center of the Sinnoh region, next to the east side of Mt. Coronet.
Inside Amity Square, you can have up to 6 Pokémon following you, but restricted to a small list:
Afterwards, you can also have your lead Pokémon follow you, even outside of Amity Square.