The first thing you need to do once you feel someone go on and put you in a bear hug/attempted bear hug, is to lean forward. Lean as forward as you can and try and get your upper body parallel to the ground. This will ensure that a direct grip cannot be formed and will save your organs from receiving extra damage.
Try and wrap one of your legs around your opponents ankles. This will keep you close to them and will ensure that they can’t easily throw your around or move you at their will.
Once you have the leg behind the attackers ankle or calf, go on and try and bounce into a standing position. This will throw them off guard, and will see you impact their face. This could lead to them letting you go right away, but it is bound to end up hurting them either way.
As soon as you get straight up, go on and bend forward. Stick your rear end as far into the attackers stomach as you can, since this will act as a pivot and see you pick them up off the floor.
Now as soon as this happens toss them on the floor and you should be free. Once you are free, you can go to work on them and take them out, or you can run. This is entirely up to you and you can decide what it is that you wish to do in this situation. However, remember to play it smart.