Hello Yolanda,
This expression is somewhat archaic and is common in literary expression. In this context, it basically means 'to give in'. 'To abandon yourself to something' means to give in to something. So in this case, the writer is saying that he/she is trying hard not to give in/surrender him/herself to despair.
Hope that helps.