Look at these sentences:
To express to struggle to [do something], to have trouble [doing something], in French, you use the idiomatic expression avoir du mal à + [infinitive].
You can also use avoir du mal avec + [noun] in order to say to struggle with [something], to have trouble/difficulty with [something].
The expression Avoir du mal never means to hurt, to ache nor can be used in the sense of fighting for [something].
Also not to be confused with Avoir mal (à) = To be in pain, to hurt somewhere