Im afraid I can't agree with engineer in only one aspect. The failure notfication has to come last. Blue Eagle has it right.
If Engineers techniques is used and the trainee hasn't seen it coming the rest of the debrief will be a waste of time.
If you give a thorough debriefing as described by Engineer it gives the trainee the opportunity to see some of the stuff he screwed up he may not have been aware of. You can almost see awareness of what has happened in their eyes as you continue with the debriefing.
It also gives the trainee a little more time to get his emotions in order for the message you finally have to deliver.
It also gives him the opportunity for the other stuff to come out.
While going through this process one day a trainee confessed he had caught his mate in bed with his wife the night before. (I happened to know that his wife was having an affair from other rumours circulating). Instead of failing him I chose to mark the sim detail as incomplete and told him to go and get some time off from the Chief Pilot and then submit himself for the sim again. I subsequently called the Chief Pilot and told him what I had done.
He was very happy with my handling of the situation.