Performing CPR on your dog probably isn’t something that you’re going to need to do, anymore than you’ll have to perform the lifesaving act on another human. That, however, doesn’t mean you shouldn’t know how. For those who will experience an event, it can make all the difference and save their best friend’s life.
As always, consult your veterinarian. Training facilities in your area likely offer a class. Don’t just read the following article and think that you can do the CPR properly. Youtube will have videos that can make the process clearer, but nothing replaces the course.