…and if that is how evolution worked, it would be a problem.
Using the mousetrap as a poor example, you start with a rectangle of wood…perhaps used to wedge a door open. Then you add some metal bits to it and turn it into a desktop paperholder. Then you add a spring mechanism and now it catches mice.
Each previous part did something. Perhaps not perfectly but quite well enough. The fact that it eventually became a mousetrap doesnt mean it was non functional before all the parts were put together becoming a mousetrap. It served a purpose each step of the way. Evolution works like that, building upon what’s already there and functioning even though those functions weren’t originally what it ended up.
If you still can’t wrap your head around it, please learn more. It’s a beautiful system.