First up, take only what you need. If something is LE/discontinued/really precious, consider how badly you really want to take it - what would you do if something did happen to it? Also try to plan some looks before you go - take colours and products that will all harmonise well together so you can maximise the looks with minimal products.
Secondly, pack smart. Use plastic travel bottles and containers. Try not to take full size anything (apart from pressed eyeshadows, powder and blush).
Now for the actual packing:
Anything that may leak - put it in a ziplock bag. Wrap the bag around the container for a little extra padding.
If using palettes for e/s and blush, lay some foam, soft fabric or (as above) toilet paper in between the top of the product and the palette to help cushion the product.
If using singles, use a cotton ball, toilet paper or fabric as described above to cushion the top of the pot.
Wrap an elastic band around the palette or each single if you're worried about the lid popping open.
Pack it all into a makeup bag that fits it all snugly so it doesn't rattle around. Stuff the spaces with tissue paper if you have to! If you're packing it into a suitcase, choose a soft (not hardcase) bag - it'll mould to the space you have.
If you're packing the makeup bag into your suitcase, put it in between clothes for padding.
Personally, I love to use a travel palette (mine is a MAC 15-pan palette with the insert removed for a flat surface) and I pack as much as I can in it. Eyeshadow, cake eyeliner, blush, powder. I also have a separate set of travel brushes - some MAC SE and a heap of cheapies - so that if something happens to them they are cheaper to replace.
Anything that I am really worried about I take as carry on.