Create a regular schedule for your dog. Make sure his meals are at the same time each day, and walk him morning and night. Try to take him out for toilet breaks using a consistent routine. Dogs tend to thrive when they have a schedule that they can follow.
Don't interact with your dog when you are frustrated or angry. Simply put your dog up and take a break. Training will proceed much more efficiently when you return. Each of you will be rested, have a fresh outlook, and be ready to tackle that seemingly elusive training task once again.