I remember the autodestruct being initiated many times, but always being aborted at almost the last possible second. Obviously, Captains Kirk, Picard, Janeway never went all the way to destruct, but was there ever any case in the TV series or the movies of a Starfleet ship where autodestruct went to completion? In any of the official books? (In the 2009 movie Star Trek, George Kirk piloted the Kelvin to a collision with the Narada, so that does not count.)
Yes. In Voyager: Deadlock, Janeway blows up the Voyager.
In "Where No Man Has Gone Before", the Enterprise picks up a ship recorder from the SS Valiant, a ship that had crossed the edge of galaxy 200 years earlier. The recorder indicated that the Valiant's captain had given an order to destroy the ship -- an order which, judging by the condition of the recorder, must have been carried out. (We don't know whether the "autodestruct sequence" we're familiar with would have been used.)
And as Politank-Z points out, it's not clear that the SS Valiant was a Starfleet vessel.
In ST:TOS, "The Doomsday Machine", the Constellation was set to self destruct in order to destroy the planet killer.
In the novel "The Kobyashi Maru", Chekov's solution to the unwinnable scenario was to self-destruct the ship and take some of the Klingons with him
Only a simulation but ....
In the TOS-era novel Star Trek Vanguard: Harbinger, captain Hallie Gannon finds herself and her ship the Bombay in a fight with six Tholian battle cruisers. After a short but heavy combat sequence, she rams the ship into one of the attacking cruisers, activating the self-destruct for extra punching power.