With clear nails it's easy to see the quick, with black nails not so easy. Despite being a made on TV product, pedipaws is helpful for black nails(or a really slow dremel with a large 120grit drum).
I've found that there is a bit of soft bed a few mm before the quick and when sanding the nail you can spot this soft spot in time to not hurt the dog.
I started my pooch with getting his front end on my lap with the back of the tool vibrating on his foot, then stopped and gave him a treat. I let him run around for a few minutes them called him over again and did a few second grind on his nail then gave him a treat and praised him till he was running around like a madman. I repeated this getting deeper and deeper until I got about about half his nail then I left him to his business for about an hour. I started slow again with a little grind, a bit more grind, then grinding the hell out of his nail till I saw the soft spot. I pinched the nail between my fingers and shined a flashlight(LED flashlight with a very focused spot) underneath and the quick was easily identified. I ground the one nail as close as I thought prudent, then gave him a treat and let him celebrate. I gave him an hour break again then brought him back and matched the other nails on that paw giving him a treat after each nail and giving him a few minutes to relish his treat. The second paw I had an idea how far to go and it worked out great, again 1 treat per nail for this first try. His front dewclaws are wiggly(vestigial) so I just trimmed them back a little bit. I repeated 1 treat per nail on the rear paws working on the same basis as the front for this first training round.
When it was time to cut them again I got him settled and made it through 3 nails before he got wiggly so I gave him a treat and let him run around. I continued making as much progress as possible till I noticed he was getting bored and/or wiggly then would give him a treat and let him do his thing.
On subsequent cutting I gave him less and less treats but he was clearly getting the hang of it. These days I break out the pedipaws and he instantly starts his "please give me a treat" dance and is delighted to jump on the bed and present his feet to me. It's usually about 1 treat per foot now and a big treat when we're done.