I have experience in using Win7. Win7 is more prone to problems than XP, and there are also prompt boxes or automatic repairs when problems occur. Generally, it is a program that comes with the system. Try it another time. If this happens frequently, there will be fewer operations that cause system program errors. If it is a downloaded program, reinstall the wrong program or replace it with similar software. If it is a system file, restore the system or reinstall the system (if it is caused by running any program, run another program, in other words, the system will follow).
Win7 restores the system, right-click the computer and select Properties, and select System Protection and System Restore on the right. Follow the steps. You can also select "Create" at the bottom of this page in advance and create your own restore point.