Clearly, pairing isn’t an issue, but here is one of the better troubleshooting guides:
https://appletoolbox.com/apple-pencil-not-working-heres-our-troubleshooting-guide/
Be aware that if a Pencil is set-aside for an extended period, unused or uncharged, the Pencil battery can be irretrievably damaged through deep discharge. In common with all Li-ion batteries, they must always have some level of charge. With regular use - and keeping the Pencil docked with the host iPad whenever it is not being actively used - the Pencil battery should be optimally maintained.
As with all rechargeable batteries, they have a finite service life - but properly used and maintained, you should reasonably expect a couple of years use before needing to be replaced with a new Pencil. The Pencil battery being so tiny, it’s ultimate service life is perhaps somewhat shorter than you’d expect from larger batteries.
Your description perhaps suggests that your Pencil battery is sub-par.
Be aware, for a neglected Pencil, the tiny internal Li-ion battery is susceptible to permanent/irreversible damage through being left discharged for long periods. Even some “new” pencils can exhibit signs of failure out-of-the-box if they are “old stock”. It is essential that if you have an Apple Pencil that you charge it regularly - whether used or not - so as to protect the battery from deep-discharge. Setting aside an unused Pencil, or a Pencil with a discharged battery, is a recipe for premature death.
If the Pencil Battery fails, the only remedy is to replace the Pencil. If the battery has failed (or is failing) and your pencil is within its one-year warranty, you should look to having it replaced by your retailer or at an Apple Store.