There are several possible reasons why your Apple Pencil isn’t working as expected; most of them are fairly simple to fix. Troubleshooting tips for Apple Pencil are largely the same for both generations of the accessory.
How to Fix Apple Pencil Not Working Issue
Your Apple Pencil battery must be charged or the Pencil will not work.
To check your iPad's battery status and verify that your Pencil is charged, do the following:
Check the Widgets view on your iPad for battery status. You can find widgets in the Today View. To get there, swipe right from the Home screen, the Lock screen, or while looking at your Notifications.