Hi ayushsharma8,
I am Dave, an Independent Advisor, I will help you with this.
That error is generated by Cortana, open the Settings App, go to Apps and scroll down to find Cortana.
Select Cortana, choose Advanced Options and then reset Cortana from the resulting page.
if that does not fix that error, re-install Cortana from the Microsoft Store: