How to distinguish between 为 and 给 when both means "for" Both 给 and 为 can mean "for." Both can be used with verbs to express an action done for anyone. 

So how can I distinguish? Please make it clear. 

Thank you so much.
My feeling is:

That 给 is for doing something ''for'' someone.

I will buy it for you. 我给你买。

You will do the verb for someone else.

And 为 is more abstract

I am sad for you. 我为你伤心。

I'm not native but I don't think you could say:

我为你买东西。  X

我给你伤心。   X