Hi meghna102,
If you haven't done so yet, restart your iPad. Although simple, this step can help correct some unexpected issues. It's also a good idea to make sure your iPad is running the latest compatible version of iPadOS 17, since this can help with overall performance: Update your iPhone or iPad
If an update is available, be sure to create a backup before installing it.
If the issue continues, and you notice this in when you use your Apple Pencil with a specific app, these steps may help: If an app on your iPhone or iPad stops responding, closes unexpectedly, or won’t open
1. Close and reopen the app
Force the app to close. Then open the app to see if it works as expected.
2. Restart your device
Restart your iPhone or restart your iPad. Then open the app to see if it works as expected.
3. Check for updates
To see if updates are available for the app, open the App Store, tap your profile icon, then scroll down to see if updates are available. If updates aren't available for the app, update the software on your iPhone or iPad.
4. Delete the app, then redownload it
Delete the app. When you do this, you might lose data that was stored in the app. Then redownload the app. Then check to see if the problem with the app is fixed.
Regards.