My rule of thumb is this: Proportion is everything. Incorrect proportions can make you too tall, short, or wide, too thin or too fat, pear shaped and sometimes upside-down pear shape (is there a name for that shape?) Also, your pants should never be see-through, even if you are wearing a thong; don't ever forget the LuluLemon fiasco.
Let's use the lovely pants and leggings from J. Crew:
Simply ways to avoid these unflattering lines? Pair the straight hem of a t-shirt or sweater with the curved hem of a button down or tunic (see above.) Tuck a little piece of the shirt into the waistband or belt of your pants to break up the line, or leave it un-tucked in the back. Baggy tops are best proportioned with curve-hugging pants (or leggings when appropriate.) Skin-tight tops look fine with bottoms that have some weight - like denim (even skinny jeans - but no one should own a pair of jeggings, I'm sorry.) Flowy, full maxi-skirts look best paired with a fitted top. Baggy tops, baggy bottoms - hard to pull off. Skin-tight everything? Only in ballet.
My favorite way to wear a knit pant?
and a legging:
Should leggings (or knit pants resembling leggings) be worn as pants?
31 Days of Styling Tips