Dandelions love a pH of about 7.5. Grass loves a pH of about 6.5. So if your pH is 7.5 or higher, your grass will probably never beat out the dandelion. Lower the pH to 6.5 and your grass has the advantage!
Be sure to have your pH tested professionally. The kits that you can buy in the store will often give you the wrong information. I once spent $18 on a pH meter that told me that my lawn pH was 6.0 when it was really 7.8. So I should have added gardeners sulfur, but instead I added lime!.
If you’re going to buy a pH tester, be prepared to spend around $85 for the tester and the calibration solutions. A long time ago I bought the Oakton pHTestr 2 plus 4.0 and 7.0 solutions. I think most folks will wanna keep their $85 and just pack some soil samples to the local extension office.
A little side note: a dusting of lime on the soil surface has been shown, in most cases, to nearly double earthworm reproduction.