Cobalion, Terrakion, and Virizion are Pokemon commonly referred to as the “Swords of Justice”. They appear in Sword and Shield’s Crown Tundra as a side quest. In order to get them to spawn, you will need to find a total of 150 sets of footprints. After you find 50 sets in a particular area, talk to Sonia in Freezington. Depending on where the footprints were found, you can find one of the legendary Pokemon roaming around there. Finding 50 sets of footprints in the Giant’s Bed, Frostpoint Field, and Old Cemetery will cause Virizion to spawn in the Giant’s Bed (it and the other two will be level 70). Finding 50 sets of footprints in the Roaring Sea Caves, Frigid Sea, and Three Point Pass will cause Cobalion to spawn in the Frigid Sea. Finding 50 sets of footprints in Dyna Tree Hill, Lakeside Cave, and Ballimere Lake will cause Terrakion to spawn in the Lakeside Cave.
After capturing Cobalion, Terrakion, and Virizion, head to the small island in Ballimere Lake (make sure they’re in your party). Once there, make some curry in Pokemon Camp. Once it has been eaten, Keldeo will appear on the island at level 65. Unlike Cobalion, Terrakion, and Virizion, Keldeo is shiny locked. Also unlike the other three, if you knock it out, you run away from it, or if it knocks your team out, it will not respawn.