How are you connecting the Pencil to the iPad? THe iPad 10th Generation has a USB-C port while the pnecil has a lightning connector under the rear cap. You need a special adapter. The regular adapter that used to come with the First Gen Apple Pencil does not work for this.
Make sure you are using the correct adapter.

click here ➜ Pair and charge Apple Pencil with iPad (10th generation) and iPad (A16) - Apple Support
If you go to Settings ➜ Bluetooth and the Pencil is there but says "not connected", tap on (i) icon and then on Forget Device to remove it. And see if it will pair again.
click here ➜ If your Apple Pencil won't pair with your iPad - Apple Support
If you are using the correct adapter, the next step is a full restore without using a backup. If it connects then, it may be an issue with some data corruption in your iPad's orignal data.
click here ➜ Restore iPad to Factory Settings - Apple.com
If it still won't connect after a restore, then you'll need to take it in to an Apple Store to get it diagnosed.
click here Get Service for Apple Pencil connection Issues - Apple Support