Restart the machine and keep pressing "Shift" to get into Windows Recovery mode. Then choose "Troubleshoot","Advanced","Startup Repair" or "System Restore".
If it is not available to acccess the Windows Recovery mode by restarting the machine. We could choose to start from an installation media.
To upgrade to Windows 10 from Windows 8.1, we could refer to the following link:
How to upgrade to Windows 10 from within Windows 8.1 or Windows 7 using Windows Update
If the issue persists, we could try to un-plug all the external devices to have a check. Please ensure the machine has got the latest updates before we try to upgrade it.