The f9 is for when you cant get into windows but you can use it either way.
From windows
Start>settings>Update and security>Recovery>Reset this PC.
To get to factory state simple choose reset>OK>Only the drive where windows is installed (unless you want to wipe the D drive too then select all drives)>Just remove my files(fully clean takes forever as it wipes the drives) then on the follwing screen click the OK, last chance to back out as once you click OK on the last screen you are committed.
When its done you will be back to just like it was when you pulled it out of the box (with the exception of your D drive if you kept those files). When it reboots you will see "Hello" and be entering initial set up just as you did the first time you powered it on.
“Two things are infinite: the universe and human stupidity, I'm not sure about the former” ~ Albert Einstein