We don’t learn and then do.
We do and then we learn.
We learn by making mistakes. We learn by getting things wrong, trying again, getting them slightly more right, trying again and so on until we get the outcome we want.
We learn by interacting with the world and seeing what happens, by testing reality and seeing how it responds.
The initial result might not be what we were looking for.
But it’s only by getting it wrong that eventually we can get things right.