Why does my drill stop and start working when it feels like it?
If it's a corded drill, that's a common sign that the cord is going bad and it's time to replace it. It might also be the power switch (see below).

If it's a battery drill then look to the power switch. Dirty contacts will cause intermittent power loss. You may just have to spray some contact cleaner into the switch assembly and work it a few dozen times, repeating the spray too, to get things working reliably. Battery contacts might also have gotten dirty. Clean them.