In Pokemon Sword/Shield, you get exp candies from completing Max Raid dens. You can also buy Rare Candies from the BP shop for 20 BP. There's also a chance to get it from using the ability Pickup if the Pokemon is level 11 or higher. You can get one from exchanging 100 watts with a hiker in the wild area (but only sometimes, since they randomly spawn), from Pokejobs, or winning the Loto-ID in poke centers.
The places you can find rare candies in the overworld are:
In Hammerlocke, hidden by wall north of Poké Ball statue in top right of town.
On Route 2, hidden in front of the tree on the middle island, but it requires the Rotom Bike upgrade.
On Route 4, hidden by a rock in south east of the southern grass patch.
On Route 6, hidden in front of a rock by the pool in the far right of route.
On Axew's Eye, hidden in the middle of three small rocks on the eastern part of island, and it can respawn.