The best way to free up RAM is to close unused apps. You should also prevent these apps from running in the background so they don't consume RAM. Another way is to adjust your startup apps and restart ...
If you have accidentally turned off your Windows computer during the factory reset and now you cannot use your system, use the following fixes: Disconnect all the peripherals and the power cord.