connect a ethernet networking cable is the best solution,
or you can connect the Wifi later
on your mac computer keyboard, hold cmd + R
then turn your mac on
connect your Wifi
choose disk utility first
then partition your new disk
then close the disk utility
install new MAC OS from the menu