First - understand your iPad model; you can find your model details here:
Settings > General About
Not sure which iPad you have? Identify your iPad model.
Next, verify that your Apple Pencil is compatible with your iPad. Here is the full compatibility list for Apple Pencil and iPad:
Apple Pencil (2nd generation)
You can use Apple Pencil (2nd generation) with these iPad models:
- iPad Air (4th generation)
- iPad Pro 12.9-inch (3rd generation) and later
- iPad Pro 11-inch (1st generation) and later
Apple Pencil (1st generation)
You can use Apple Pencil (1st generation) with these iPad models:
- iPad (8th generation)
- iPad mini (5th generation)
- iPad (7th generation)
- iPad (6th generation)
- iPad Air (3rd generation)
- iPad Pro 12.9-inch (1st or 2nd generation)
- iPad Pro 10.5-inch
- iPad Pro 9.7-inch
If your iPad and Apple Pencil are compatible, this support page will walk you through setup and use of your Pencil and iPad:
Connect Apple Pencil with your iPad - Apple Support
Should you continue to experience difficulties, this troubleshooting guide may be helpful:
https://appletoolbox.com/apple-pencil-not-working-heres-our-troubleshooting-guide/