Faced with Criminal Acts, What's Legal

This article makes me want to find out what is okay and what is not okay to do with people you witness doing criminal acts.

There have been times i’ve been on the subway and seen cellphones snatched and had a friend of mine once get punched in the face for no apparent reason (I didn’t witness this). I have never been in situations where I had an opportunity to stop the crime from happening, but if I were, I would be very hesitant to do anything for fear of being sued.

So i guess my question is, if I see a guy steal a phone and run, am i allowed to tackle him and hold him until the cops come?

If i see a cop struggling to arrest someone, am I allowed to help the cop?

Or with the video of the naked guy in San Francisco, obviously that guy was harassing people, but would me punching him get me in trouble?

Or if a guy grabs my girls ass, what am i supposed to do without facing legal troubles. Just give him the death state o_0

Obviously I would like to do the right thing and put the criminal in his place, but you always hear about people getting sued for shit and I don’t want to be on the wrong end of it.