Another vote for tea and toast here. In fact any sweet, warm, milky drink seems to calm me down if things are getting hectic - just getting up, going to the kitchen and putting the kettle on often does the trick. From memory, there's a chemical in milk that soothes you anyway. Certainly seems to for me.
Also, if things are just spinning out of control I find lying down - preferably in bed wrapped in a duvet if it's chilly - closing my eyes and breathing helps a lot. Calming music, as has already been mentioned, I find very useful too - sometimes I find some music that I would normally love to be quite disturbing whilst tripping.
On the sedative issue, I
always have some benzos on hand "just in case" although I use them incredibly rarely whilst actually tripping - very occasionally I may take 5-10mg of diazepam on the come-up if it's a particularly rough one. I would usually use them - if at all - when the fireworks are over to get rid of the cracked-out feeling that some psyches - especially the long-acting or relatively high bodyload types - and just get cosy. GBL does the same thing for me, but many don't like the mental clouding that it brings, but I find it very relaxing. Addmitedly I use it a lot anyway... Tea (or even better Horlicks or hot chocolate) is again vital at this point.
Basically, anything that makes you feel comfortable, cosy and safe. Or just something to distract you - sometimes I'll watch something comedic on the come-up to create a happy headspace and pleasing diversion. And, as Mr B mentioned, someone to cuddle and communicate with is probably the best cure for bad trips you can get :D
Personally, I find the come-up to be the prime offender for dodgy mental states. Once the trip proper starts I'm generally too entranced and wrapped-up in what's happening to worry anymore. Also, as Issy mentioned, the expectations you go in with can make a big difference. I'd put money on the idea that the vast majority of bad trips come from worrying about bad trips. I don't think I've ever really had a properly bad trip - just some hairy moments that felt like forever but are nothing of the sort.
Good luck, don't worry too much, and happy tripping


