Fundraising is usually not done on day 1 - generally, you need to have done enough validation work to prove initial traction / show knowledge of market needs before you can successfully raise a round of financing.
For a software company, you will need to show initial traction before you can even raise a seed round. Initial traction means you need to have acquired customers and perhaps have started taking in a revenue stream.
For a hardware company you will need to have enough progress to indicate technical feasibility and also have primary and secondary market research backing your claims that there is a good market and this is a good solution. You will need to raise sooner and it will be more difficult but that’s the way hardware startups have to go due to the prototyping cost.
Generally the longer you can bootstrap the better off you are. You should never recreationally fund raise, you get to the point where you are ready to pitch then you just pitch. It is very time consuming.