Brews one or two cups then puts ground in coffee
If you are using the "store bought" Keurig brand K cups for making coffee in the machine, you may just need to clean it by running several "cups" of just water - NO K cup - thru it, into a large white cup. This will NOT hurt the machine, but will clean out most residual grounds in it. The white cup will show you what comes out. Then hold the machine over the sink and using the sink sprayer, open the lid, pop out the K cup holder and spray hot water down thru the opening where the K cup holder sits, then wipe everything you can reach, top and from below, inside and out, with a damp dish towel over one finger. Then clean the K cup holder with hot water and an old toothbrush and reinstall it. EZ.
If this doesn't completely fix the problem, check the soft black rubber (neoprene) seal that fits around the top puncture needle inside and under the lid that comes down over the K cup when you close it to brew. You can't see this part very well, but you can feel it with fingers easily. It is about 3/4" in diameter, maybe 1/4" thick and just slides on over and around the top needle. (there is a bottom needle in the K cup holder, too) If this seal is damaged or missing, that's the problem. It needs to be cleaned every few months anyway, just pop it out, rinse it and replace it. EZPZ.
Now, if you are doing the "load your own coffee" aftermarket plastic cups, the problem may be the refillable cup. But you need to do the cleaning steps outlined above anyway. There are a variety of these, I have them all and use my favorite ones. Some of these plastic cups will deform over time and not seal against the seal described in the paragraph above. If this is the problem, do all the above plus replace the refillable cup. Try a different kind this time.
These machines are very well designed and made. The inside of these coffee machines are CRAMMED FULL of tubes, valves, wires, pumps, a boiler, and electronics. They are NOT designed to be repaired, just replaced. But the above cleaning should be done on every one of them every few months and they will last for years.