Definitions of be at pains:

  • verb:   try very hard to do something