You might hurt youself by chopping onions with an axe.
It seems that using by instead of with is better in my sentence but I'm wondering whether 'by' can be used in the original sentence. 'By' signifies the method whereas 'with' denotes the tool.
Ivanhr'By' signifies the method whereas 'with' denotes the tool.
As I see it, "with" in the original sentence is used rather imprecisely to join the two clauses and indicate that the second explains the circumstances of the first. I think this usage is OK conversationally but probably not recommended in formal English.