Seated side bends, can be used to stretch the side of the torso (the waist, the intercostal spaces), the shoulder (if the arm reaches over the head). They can also be used to stretch the hamstrings if the leg that is being bent towards is straight.
If using seated side bend as a hamstring stretch, you can sit with both legs straight. Or you can bend the other leg (the leg you aren't bending towards) so that the foot is either inside the thigh (as in janusirsasana) or towards the outside (as in hero pose.
Another way that you can use seated side bending poses is to stretch the quadriceps as well as the side of the body. To do this, you can sit upright with one leg in hero pose. Bend your upper body towards the hero leg side.
To stretch the quadriceps as well as the side of the body while sitting, place one leg in hero with the shin to the outside of the thigh. Bend the other knee and position the foot to the inside of the thigh.
You may find that the hip on the hero side rises up.
To make the hero leg knee more comfortable, try activating it to make it feel strong. If you have difficulty holding the activation, practice activating and relaxing. As you get more comfortable, bend towards the hero leg side.
With the hero leg hand on the floor, bend your upper body towards the hero leg side, slowly.
To add weight to the stretch you can try lifting the hand. To add more weight you can try reaching one hand, and then the other out to the side.
Make you arms feel long as you do this. Make your spine feel long also.
Bending to the side with both legs straight, you can start by resting the bottom most hand on the floor. You can use it to help support the weight of your body.
Depending on your flexibility, in particular, how wide you can open your legs, you may find it helpful to place the bottom hand in front of the straight leg or behind it.
Another option is to do this seated side bend with your knees bent.
So that the leg that you are bending towards is active, try pressing the heel of that foot down strongly. You may find that you an activate your hamstrings by doing this. Additionally, work at making your spine feel long.
When ready, try lifting your bottom hand off of the floor. Then smoothly reach it to the side, past your ear.
You can reach the top arm to the side also.
If you can sink deep enough you can try grabbing the foot with your top hand.
Once you grab onto the foot, try pressing the foot down using your leg muscles while trying to pull the foot up at the same time using your arm and upper body. Vary the tension so that you can gradually, and comfortably, work deeper into the seated side bend.
Repeat on the other side.
An option is to bend one leg and place it in hero position. From there bend towards the opposite leg.
For this variation, the steps are pretty much the same. One thing you may find is that you can allow your bent knee hip to lift in. That can make it easier to grab your foot with your top arm.
Because the hip is allowed to lift, you'll get a reduced side bend of the spine. But you'll also get more of a handstring stretch.
Because the hip can lift, you may find it much easier to grab onto the straight leg foot with both hands in this variation.
If you do grab onto the foot with the top hand, as well as adding tension to the leg, the arm and the torso, you can try sinking the bend knee hip also.
Another hamstring stretching seated side bend option is to bend one leg so that the foot is against the inner thigh of the opposite leg.
Here too you can bend towards the straight leg. You may find that this is a bit more difficult. The foot position of the bent knee leg may make it harder for the bent knee hip to lift. I'd suggest actively pressing the bent knee foot into the floor so that the bent knee leg is active. As mentioned previously, to make the straight leg active, press the heel of the straight leg foot down into the floor.
For any of the hamstring stretching side bend options you can try turning your torso away from the straight leg, or even slightly towards it. Additionally, you can play with back bending your spine and forward bending it. In either case, make the changes slow and smooth and stop if there is any sharp discomfort.