Hi Prabh33, please check that if you have followed the below steps:
Check the app permissions:
In order to communicate with your S Pen, the Air command app must have the permissions for Nearby Devices and Physical activity enabled.
From Settings tap Apps >> Tap the filter icon next to Your apps >> Tap the switch by Show system apps to turn it on, then tap OK >> Tap Air command, and then tap Permissions >> Tap Nearby devices and make sure it's set to Allow. Do the same for Physical activity.
Reset the S Pen:
Attach the S Pen to its designated spot >> From Settings, search for and select Air actions >> Tap Air actions again, then tap More options (the three vertical dots), and then tap Reset S Pen >> Your S Pen will now be reset and you can begin using it again.
If your S Pen is still not connecting to your device after performing the reset, you will need to replace your S Pen.
Please contact Samsung Canada Parts for purchasing the part by referring to the part name and the product’s model number.
Please access the below link for visiting the web-site of Samsung Canada Parts. Please turn OFF pop up blocker to access the link below.
You can also reach them over the phone at 1-877-407-6593 (Toll-Free number)
Hours of Operation (EST): Mon - Fri: 7:30am to 8:00pm, Sat: 8:00am to 4:00pm. You can email them at: email@example.com
Thank you Helenna.
Besides that, there are other solutions as well. And they could be worth trying.
I can't write all the solutions here, but here is a helpful and informational post - Fix S Pen Keeps Disconnecting On Samsung Note 10 (Plus)
It might help OP.