Even if you don't sell guitars for a living, there's a good chance at some point you'll need to ship a guitar--and you'll want it to arrive at its destination in the same condition it left. I've been shipping guitars almost daily for more than 15 years and have learned a few things along the way. The tips below mostly apply to a solid body electric. Acoustics are a little different.
First off, use quality packing materials! At the very least, it's really worth getting some good quality bubble wrap, packing tape, and a good sturdy shipping box. For the bubble wrap, get the thick type with large bubbles--not the tiny bubble variety. A box specifically made for shipping guitars is a must. Ask your local guitar shop to put one aside for you, or go to Reverb.com. You can buy a 3-pack of boxes for around $35. If you want to go all out, you can get some packing peanuts and/or packing paper, but it can be done without those.
You'll want to loosen the strings on the instrument. Just a couple turns should be enough. This will avoid any extra stress on the neck during temperature changes. Some people like to put a layer of paper between the strings and frets. This avoids damage to the frets. If it's a high end instrument, or brand new, this may be worth it.
If you're shipping with a hard case, make sure the guitar can't move around inside it. So close the latches and gently move the case back and forth. Hear the guitar moving? Then you should use balled up newspaper or something to make a little cocoon inside the case. This may include placing paper under the body to snug it up against the top of the case. Also watch for how the neck and head are supported inside the case. Some Gibson cases try to give support to the neck but can end up being a hazard during shipping.
Pack whatever you need to around the head and neck so they have support. Spend a few minutes watching some videos online. Reverb has a good video on packing/shipping a guitar. It's only about a minute long, but it shows you visually some of the things I'm describing. Or go to youtube.If you're shipping without a hard case, you'll want to create a "case" out of thick bubble wrap (see image above). This means tightly wrapping the body of the guitar with at least 2 or 3 wraps of bubble. Then do the same to neck and head. At the end, the guitar should be completely covered in bubble wrap. It may be worth removing the strap pin on the butt end of the guitar. Very common for that to get crushed into the body when a box is dropped on its end.
Make an Endcap: Once the guitar is in its hard case or bubble case, make a pad for the bottom of the case. You can use thick packing paper and wrap or wad it up till it is at least an inch thick and very dense. Some people just put that at the bottom of the box. I prefer to take that thick wad of paper (this can also be an inch or more of styrofoam or other material) and tape it to the bottom of the case. That means several long pieces of good packing tape used to keep it in place. I feel it avoids this "end cap" from moving around during shipping and possibly leaving the bottom of the guitar vulnerable. Beyond neck/headstock problems, the bottom of the guitar where the strap pin is located is one of the most damaged areas. Shippers typically drop boxes on the end with the most weight, thus banging that part of the guitar. That's why this end cap is very important!
Put the guitar in your sturdy thick cardboard box. Now, pack whatever material you have around the case. This creates another cocoon inside the box for the guitar. I like to use peanuts first because they are small enough to fill up the narrow space left on either side of the guitar body. If you don't have peanuts find a way to squeeze some packing paper or newspaper along the sides. Paper may not simply fall into the 1 or 2 inch gap left on either side of the guitar body. If not, open up the bottom of the box and force it in from that side--whatever it takes to get some material between your case and the edge of the box.
Typically I'll fill with peanuts up to the start of the neck area. At that point you can use paper or even more bubble wrap to fill up all the space left on either side of the neck. Finally, hopefully you have an inch or two of clearance left at the top of the case. Create another "cap" of wadded paper or styrofoam
(pictured above) to protect from drops to this end of the box. Now tape up the box. Throw a few "Fragile" stickers on the outside, or lacking that, write it in magic marker.
Here's a tip: make sure your shipping label is well-anchored to the box. If using a FedEx or USPS label holder, tape down an edge of it too. Sometimes they fall off during shipping. These are just some of my shipping tips. Read all you can and watch videos. Good luck!