Ensure that the user-replaceable Pencil tip is snugly screwed into position; when fitted correctly you should see a tiny gap, of about the thickness of a sheet of paper, between the tip and pencil body. If slightly loosened, or overtightened, the Pencil may not work properly, if at all.
Verify that your Apple Pencil is compatible with your iPad:
Apple Pencil compatibility - Apple Support
Assuming that you have an Apple Pencil that is compatible with your iPad, this support page may be helpful with pairing and use of the Pencil with your iPad:
Connect Apple Pencil with your iPad - Apple Support
If you continue to experience difficulties, here is one of the better troubleshooting guides:
https://appletoolbox.com/apple-pencil-not-working-heres-our-troubleshooting-guide/
If you cannot resolve the problem, you would be best advised to visit the Genius Bar at your local Apple Store or Apple Authorised Service Provider (AASP) - where the technicians will be able to test and assess your iPad and Apple Pencil:
Genius Bar Reservation and Apple Support Options - Apple