trying
attempting
En essayant, j'ai fini par comprendre ce qui n'allait pas.
By trying, I eventually understood what was wrong.