Your toddler's domain extends as far as his eye can see. By nature, toddlers aren't particularly sensitive to the needs or feelings of others, nor do they recognize personal property, unless they're holding it. And that means everything is up for grabs -- literally. His baby sister's rattle? His for the taking! Your great-aunt's hand-blown glass figurines? His, too! And who cares if his playmate happens to be enjoying that plastic hammer; if he wants it, he grabs it.
Interrupt your grabby gibbon as soon as he acts by saying, "Stop. No grabbing." The sooner your intervention is after the actual grabbing act, the more effective your words will be. Obviously, you'll need to tailor your reproach based on the age of your tot. "Stop. No grabbing," is sufficient for an 18-month-old toddler, but a 2-1/2-year old would benefit from additional elaboration. For example, "Olivia, it is not okay to grab things from other people."
Approach the grabber while telling him to desist. After telling him that grabbing is unacceptable, tell him to return the object in question to the original handler. Explain that he can play with the toy after his friend is finished. Ideally, he will cooperate and return the toy to his friend. There's a good chance, however, that he'll hold on tighter, try to run or display an array of possessive shenanigans that will force you to forcibly remove the item from his hand. Obviously, grabbing something from his hand to teach him that grabbing from others is wrong is a somewhat muddled lesson, but it's better than allowing him to keep the item he grabbed without consequence.
Reiterate again that he may hold or play with the toy when it's his turn. Give toddlers younger than 18 months a replacement toy to distract them from the perceived gross injustice of having the toy they wrongfully snatched removed from their clenched fist. For older toddlers, who understand the concept of a clock, set an egg timer for two minutes. After returning the toy to the grabbee, explain that the grabber may have a turn in a few minutes when the clock dings.