If you have Windows 10 restart your computer 3 times in a row BEFORE reaching Windows Desktop. It should go automatically into Windows Troubleshooting menu.
Click on Startup issues with Windows and see if that fixes your problem or not.
Otherwise you can also start your Windows Installation flash drive or DVD and then enter the Troubleshooting menu.
If startup issues doesn't fix your problem try using restore point from the same menu and restore your Windows to an earlier period before that error started showing up.