Here's a neat trick that's actually been around for thousands of years. All you need is a bit of rope (enough to wrap around your waist plus a bit extra). Seriously, don't underestimate what you can do with rope.
Pull your pants up a bit above where you'd normally wear them. Take the rope and wrap it around your waist, a few inches below the top of your pants waistline. Tie it off with a knot tight enough that. A square knot will do if you are in a rush, but a bowline is surely the best option as it won't slip and can be pulled tight. If you've done it well, you'll find that your pants don't fall off. If not, you probably need to tie the rope a bit tighter.
If you have pants which are especially long, you can pull them up more than above. Then fold the tops over the rope. If you fold one complete revolution all the way around the rope, you'll make a toroidal loop which surrounds the rope. That will be relatively stable due to friction between the two fabric surfaces. You'll find this approach is especially effective for extra-large pants when you have some that are too big to fit you normally.
In fact, this lifehack is so useful, people started designing special ropes just for it. Some of them aren't actually made of rope, and many use different fastening mechanisms and somewhat different shapes. The end result is the same though. People often refer to these special ropes as "belts". You'll also find pants which are made with special loops of fabric. These "belt loops" do the trick above for you; just stick the rope in the loop, and it can't slip out unless the fabric rips. Sometimes pants come with elastic ropes built in to them; I've found these often snap or fall inside the pants in such a way that they are inaccessible; in that case, so long as you have more rope, it's no problem (just follow the steps above).