The safest way to trim your dog’s nails is to use a guillotine or scissors clippers. The latter is better for larger breeds or dogs with thick nails. If you cut the nail down to the quick it will bleed. On a white nail, the quick is the pink area and is easy to see, so you can judge to cut safely in front of the quick. With guillotine clippers, slip the nail into the stationery ring and squeeze the handles to move the cutting blade to trim the nail. For black nails, take a little off the tip, even if you make a few small cuts. Rough edges can be filled after cutting.
If you have a puppy, regularly play with his paws and toes and even place the nail inside the clippers (even if you don’t need to cut) just to get him used to the process. If you inadvertently cut a nail too short, a styptic pencil, used by men for shaving nicks (available at pharmacies) will stop the bleeding. Keep one in your first aid kit as a precaution.
And if you’re struggling to do it, rather ask your vet or a professional groomer.