The safest way to ship a bike is to take it to a local bike shop and pay to have them pack it and ship it to you. Total cost is usually under $100.
It'll cost you about $50-60 to ship it yourself. You could stop by a bike shop and ask for one of the bike boxes they receive bikes in (they typically throw them away). If you go this route, ask them to save any packing material that might come with it, and any extra they may have. It'll be a tight fit, but keep in mind that the wheels and handlebars will have to be removed. If you're not comfortable with this, best to let them handle the job.
If the bike isn't packaged securely, shipping can be really hard on it. If it's a nice bike, it'd probably be worth it to have someone do it for you. If it's a Walmart special, save your money and go buy a new one.