If you can substitute a noun, and the sentence still makes sense, then its a gerund.
A friend of mine was accused of stealing food
A friend of mine was accused of a crime food.
In the first sentence "a crime food" doesn't make sense. Therefore, stealing is a participle.
I like swimming every morning
I like coffee every morning.
In the second sentence, "I like coffee" makes sense, so swimming is a gerund.