Ensure that the user-replaceable Pencil tip is snugly screwed into the body of the Apple Pencil; 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.
Be aware that if the Pencil has been dropped onto its tip, or if the tip has been subjected to unnecessary force, the transducer element that its located beneath the replaceable plastic tip may have been damaged; a damaged Pencil cannot be repaired - only replaced.
If you need assistance, the technicians at the Genius Bar of your local Apple Store or Apple Authorised Service Provider (AASP) will be able to fully test and assess your iPad and Apple Pencil:
Genius Bar Reservation and Apple Support Options - Apple