Way 1
To enter Safe Mode, first open the Command Prompt and type bcdedit.exe /set bootmenupolicy legacy, then restart the PC. Press the F8 key continuously until the Safe Mode options appear.
Way 2
Step 1:Boot from the installation drive and select your operating system. Then click on 'Repair your computer' in the Windows installation dialog box.
Note:
How to change the boot pendrive: check this blog.
Step 2: Choose the option displayed on the screen, then click on 'Troubleshoot' and select 'Command Prompt.
Step 3: Enter the command chkdsk /f C: and chkdsk /r C:, then enter bootrec /fixboot and bootrec /fixmbr.
Step 4: Now exit the Command Prompt and press 'Continue' to boot into Windows 10 or any other operating system.
Now your operating system is working properly and is back to normal.