If someone grabs you and your hands are free, that's good. You can use your hands to strike the attacker. In case the attacker grabs your one hand, you can use your other hand to strike him. How about if the attacker grabs your body with both arms?
There are situations where you can simply strike and hit the attacker. As a result, the attacker has to let you go. There are situations where you might not be able to strike the attacker until you get yourself free.
Let's watch this video. Here the attacker grabs your body with both hands. Even if you cannot strike, you can grab the attacker. You can follow what is shown in the video. You need to move one leg behind the attacker's leg and throw him on the ground.
What if this technique does not work?
That's an effective self-defense technique to release yourself. There might be some reasons if that does not work. The attacker usually does not just hold you like this. And if you try to do something, will he just keep quiet? That's unlikely to happen.
After grabbing, the attacker can move you here and there. You might not ground yourself properly. In a situation like this, you cannot use your full strength. Or, the attacker can lift you up. Your legs are not on the ground anymore. That can be a problem.
First of all, make sure that the attacker cannot lift you up or move you here and there easily. As soon as the attacker grabs you like this, drop your weight down and ground yourself properly.
Now the attacker finds it hard to move you or lift you up. Then you can apply this technique to defend yourself.