90% of people asking this question do so because they talked to the Day Care helper, and they said something along the lines of "your Pokemon don't like each other". If this applies to you, then your Pokemon WILL breed, just at a lower rate than possible. That is: you need to walk more steps on average to get an egg.
For SCARLET/VIOLET players: you must use Egg Power to breed with any efficiency. As outlined here, breeding with an Egg Power generates Eggs 50× to 100× faster than breeding without.
If none of the above applies to you, then use the per-game "quotes blacklist" below to confirm whether your Pokemon are compatible. If you find your Pokemon are incompatible, check the list of reasons why your Pokemon may be incompatible at the bottom of this post to find out why.
Quotes blacklist
If you speak to the Day Care/Nursery helper in your game and they make any of the following statements, then your Pokemon are not compatible for breeding. If the helper doesn't make any of the EXACT statements below, then your Pokemon ARE compatible for breeding.
G/S/C: "It has no interest in [Pokémon]."; "It's brimming with energy."
R/S/E/FR/LG: "The two prefer to play with other Pokémon than each other."
D/P/Pt/HG/SS/B/W/B2/W2/X/Y/US/UM/Sw/Sh/BD/SP: "The two prefer to play with other Pokémon more than with each other."
OR/AS: "Those two would really rather play with other Pokémon, though, and not each other."; "Seems they’d rather play with other Pokémon—not so much with each other."
S/M: "They don't seem to like playing together, though."
S/V: n/a, see above
Reasons for incompatibility
This is an exhaustive list of reasons why your Pokemon may be incompatible for breeding. If you read it carefully and open the links, you will find the reason your Pokemon won't breed.
If your Pokemon are incompatible, then you must get new parents. There is no way to turn an incompatible pair into a compatible pair.
No common Egg Group: For two Pokemon to breed, they must have at least one Egg Group in common. If they do not, they will never breed. In particular, there are some Pokemon (including the Ralts line) that have a different Egg Group prior to Sword/Shield; those are listed here.
Same gender: For a breeding pair to be compatible, one Pokemon must be male and the other must be female. If the Pokemon have the same gender, then they will never breed, even if they have the same Egg Group. The only exception is breeding with Ditto, where gender does not apply.
Genderless: Genderless Pokemon cannot breed, unless they are paired with Ditto.
Undiscovered Egg Group: All Pokemon belonging to the Undiscovered Egg Group are unable to breed. This includes all Legendary and Mythical Pokemon (except Manaphy), Ultra Beasts, Paradoxes, Gen 8 Fossil Pokemon, "baby Pokemon" (details), and oddities like Nidorina and Nidoqueen.
Ditto on Ditto: Ditto cannot breed with other Ditto.
Gen 2 in-breeding: This applies if you see "It's brimming with energy." In Gen 2, Pokemon will not breed if their Defence IV is the same and their Special IV is different by 0 or 8. The mechanic is designed to stop you breeding Pokemon with their children. It works because in Gen 2, offspring always inherit the Def IV and the SpD IV different by either 0 or 8 from the parent of the opposite sex. However, unrelated Pokemon can be affected by this feature on random chance, if you're unlucky. Just replace one of the parents and try again.