If you’re using the original Apple Pencil and find that it suddenly stops working, it’s possible that the battery has become depleted.
If the pencil is fully charged, and shows up as paired to your iPad, then the problem may be caused by a loose tip.
The pen will not work with a loose tip. Turn the tip clockwise to make sure it is snug. This may fix the issue.
If the tip is broken or lost, it can be replaced for a few dollars per tip. [View]
The tip of a first generation Apple Pencil is removable by carefully turning it counterclockwise. The tip is somewhat fragile because it is made of plastic and the internal metal threading seems to be very fine so presumably it could be stripped or damaged if installed incorrectly.