Generally the first thing to happen will be the driver initiating an Emergency Call on the GSMR (in-cab) radio - which alerts the signaller immediately and will also stop other trains in the vicinity. If the driver reports or even suspects "one-under" (as it's often called) then the signaller will in turn be initiating alerts to Network Rail Control, the Train Operating Company Control, British Transport Police, Fleet Engineers, and other emergency services as needed.
In some scenarios, if the driver is able to, they may also contact British Transport Police themselves to give their initial statement over the phone. The driver's Team Manager will also be alerted (whichever one is on call) and will come out, often accompanied by another driver who may have been spare or at home, this is so that the Team Manager can relieve the driver who's had the fatality on the spot.
After that, probably changes between companies, but sometimes, the driver concerned is driven back or taxied back to depot to give their "debriefing" and statement, before being taken home. The driver is obviously considered in no fit state to take any train anywhere after a fatality, and with good reason.
As far as the train and passengers affected: until the British Transport Police and forensic team have come out to conduct a full survey and search of the scene (which can take quite some time, as you might imagine a train doing 70mph could potentially convey, shall we say, debris, quite some distance during its emergency stop. The train itself needs to be checked too, so the Fleet Engineers / Rolling Stock Technicians do that, to see whether it can or cannot be moved safely. Then the clean-up starts, with a specialist team brought in, and again this can take quite some time.
And then it depends: if the train has suffered severe damage (in one case I know of, the oil sump got knocked clean off the underneath of the engine on a multiple unit) then it might be necessary to do a controlled evacuation of the passengers to either another train or a nearly platform. If it can safely proceed, it can only happen once the "crime scene" has been fully inspected and declared clear by the relevant authorities.
That's why the whole thing can easily take a couple of hours or more to clear, on the day.
And afterwards, the driver concerned will be offered counselling services, will generally be encouraged to have a suitable period of time off to ensure they are fit to return to work, and will have to give a full statement to the British Transport Police as well. These days the driver does not, afaik, have to attend the Coroner's Court, thankfully, as it was often said this could be more traumatic than the actual fatality itself, especially if the family of the bereaved decided to try and blame the driver for "not swerving" or "being distracted" or any number of things.
EDITED TO ADD: I forgot to add that the effect of having a fatality on the driver varies widely, nobody knows how they will react until it happens. I know of three drivers who have had over SEVEN fatalities in their career, and are still driving, but also of another who after one fatality never drove again. Largely that comes down to the circumstances: in the latter driver's case, it was two young children who were innocently playing on the track having been told it was fine by their step-parents, who were nearby sunbathing.