is used to suggest that
speculation about what might happen or might have happened is no substitute for dealing with reality. The traditional rhyme continues with the idea that there would be no work for tinkers if such wishes produced actual pots and pans.
If only we had inherited a fortune, we could buy that villa, but wishing won't pay the mortgage. “If ifs and ans were pots and pans.”