To extend the trot I've always thought of pushing on whilst giving half halts. On a green horse it's easier to rise to the trot than sit and exaggerate the rise so as to get the lift of the forehand. You have to be careful to contain the extra energy you're creating without stifling the gait, otherwise you end up with a flat out trot or a very annoyed shuffling horse!
To collect, sitting is easier for me. Rather than do anything with my hands or legs I try to sit up tall and suck the horse up into my seat. This way the horse goes upwards more than forwards so you keep the impulsion whilst getting collection. Half halts as usual and leg to keep the motion but the seat is the bigger part of the equation.
They're both one of those things that are much easier to do than to explain how to!
Amanda