Four months is a great age to begin training, but you can expect too much too soon. At first you are training yourself on how long your little guy can hold it. Don't forget they can hold it twice as long during the night as during the day. We kept Joey in a small crate at night by the bed, and I would take him out twice to pee and then place him back in the crate. During the day, you can crate train, but you need to take them out every hour. Many people use an xpen and just place pee pads in it. Joey took to the pee pads right away. When they are out of the crates or pens, your eyes should be glued to them and a pee pad should never be too far away. Ignore the accidents and praise the success. Some people think that punishment works if there's an accident, but it can teach them to hide their urine and poop, and also promote submissive peeing in the future. This is a good site for housebreaking information.
Indoor Potty Training - Papers, Pee Pads, Litter Boxes and more. The times they give for how long a certain age dog should be able to hold it, is not really suitable for a yorkie, they don't mature as fast, so decrease the times by half.