It simply means to 'Prevent some harm coming to us or ourselves'. Firstly, in decent English usage, the word 'ass' can also mean a 'donkey'.
But, I assume the meaning of 'ass' in this context is 'butt', or the 'backside'. It's indecent to use it unless with close friends. Similarly, when something wrong happens to us it is said that 'our ass got kicked'.
Another related phrase is 'I'm going kick his ass' (I'm gonna beat him or he will lose to me).
Cheers.