That's a great question! It's so frustrating when the bag slips down into the bin. Here are a few tricks I've seen and used that work pretty well.
The simplest method is to use the bag's own drawstrings. After putting the liner in, pull the strings up and tie them in a tight knot over the bin's rim or handle. If there are no drawstrings, you can twist the top of the bag and tuck the bunched-up part under the rim on the outside, letting the bin's weight hold it.
For bins with handles or lips, small bungee cords or heavy-duty rubber bands are lifesavers. Just loop one around the entire top of the bag, hooking it onto the bin's rim. You can also use binder clips or strong office clips to pinch the bag's excess material directly onto the rim in a few spots.
In a real pinch, look for what's around. A sturdy stick or piece of plastic can be placed across the bin's opening under the rim, creating a ledge for the bag's ears to hang over. The key is creating tension or an anchor point so the bag can't slide down.
Honestly, a little prevention helps too—don't overfill the bag, and try to use liners that are a bit oversized for the bin. It makes these hacks much easier. Hope one of these ideas works for your situation