It seems like .txt extension has lost its default app to open *.txt files. You just need to restore its default app. Follow the steps below:
Step 1: Open any *.txt file. You’ll get a popup to select the program.
Step 2: Click on the link: “Look for another app on this PC”
Step 3: You must use the notepad app listed there. Click on the notepad app and then click on OK.
Step 4: If you don’t see the notepad app there, then you’ll have to reset or reinstall the notepad app from its settings. Let’s see how to do it.
Step 5: Run the following command in powershell:
“Get-AppxPackage *Microsoft.WindowsNotepad* | Remove-AppxPackage”
That’s it. Hopefully this issue will be fixed after applying these steps. Please let us know if it doesn’t work.