Note: I did these for a website that doesn’t allow swearing, so I didn’t include some funny sweary ones.

Antiquity

“Give the boys a holiday.”[8][11]: 4 [17][note 6] — Anaxagoras, Greek philosopher (c. 428 BCE), in response to citizens of Lampsacus asking how they could honor his memory

“You may go home, the show is over.”[11]: 44 [17] — Demonax, Greek Cynic philosopher (c. 170 CE)[note 17]

16th Century

“I desire to go to hell, and not to heaven. In the former place I shall enjoy the company of popes, kings, and princes, while in the latter are only beggars, monks, hermits, and apostles.”[11]: 102 [21][70]: 196  — Niccolò Machiavelli (21 June 1527), Italian Renaissance diplomat, philosopher and writer

“Too late.”[8] — Fernando Álvarez de Toledo, 3rd Duke of Alba (11 December 1582), on learning that the King was to visit him

17th Century

“All right then, I’ll say it. Dante makes me sick.”[35][107][34]: 26 [108][note 85] — Lope de Vega, Spanish playwright (27 August 1635)

“I have been a most unconscionable time dying, but I beg you to excuse it.”[70]: 195 [note 98] — Charles II of England (6 February 1685)

18th century (aka the French are super sassy):

“I am about to—or I am going to—die; either expression is correct.”[7][8]: 198 (“Je vais ou je vas mourir, l’un et l’autre se dit ou se disent.”) — Dominique Bouhours, French priest and grammarian (27 May 1702)

“One hundred and forty-four.”[5]: 42 [18][22] — Thomas Fantet de Lagny, French mathematician (11 April 1734), responding to the question “What is the square of 12?” on his deathbed

“What the devil do you mean to sing to me, priest? You are out of tune.”[14]: 39 [18][30] — Jean-Philippe Rameau, French composer (12 September 1764), to his confessor

“Now is not the time for making new enemies.”[44][x] — Voltaire, French writer (30 May 1778), when asked by a priest to renounce Satan before his death

“The first step towards philosophy is incredulity.”[1]: 93 [6][ac] — Denis Diderot, French philosopher (31 July 1784)

“If you wait a little, I shall be able to tell you from personal experience.”[14]: 39 — Christoph Willibald Gluck, composer of Italian and French opera (15 November 1787), when asked whether a tenor or a bass should sing the role of Christ in The Last Judgement

“I see that you have made three spelling mistakes.”[24][26] — Thomas de Mahy, Marquis de Favras (19 February 1790), upon reading his death warrant

“I believe we shall adjourn this meeting to another place.”[58] — Adam Smith, Scottish economist (17 July 1790)

“Show my head to the people. It is worth seeing.”[16][24][26][62][ar] (“Tu montreras ma tête au peuple. Elle en vaut la peine.”) — Georges Danton, leading figure in the French Revolution (5 April 1794), prior to execution by guillotine

19th Century

“I think I could eat one of Bellamy’s veal pies.”[14][15][16][note 9] — William Pitt the Younger, Prime Minister of the United Kingdom (23 January 1806)

“I’ll be shot if I don’t believe I’m dying.”[1][7]: 167 — Edward Thurlow, 1st Baron Thurlow, British lawyer and politician (12 September 1806)

“That is surprising, since I have been practicing all night.”[10]: 19 — John Philpot Curran, Irish orator, politician and wit (14 October 1817), when his doctor said he was coughing “with more difficulty”

“Put it down, hussy! Do you think I cannot help myself?”[10]: 47 — Eva Marie Veigel, Viennese dancer and wife of David Garrick (16 October 1822), telling a servant to put down a cup of tea prior to dying at age 98

“Nurse, it was I who discovered leeches have red blood.”[1][15][57][note 41] — Georges Cuvier, French naturalist and zoologist (13 May 1832), to a nurse who was bleeding him

“Are you sure it’s safe?”[88] — William Palmer, English physician and murderer (14 June 1856), to the hangman while looking at the trapdoor on the gallows

“Ah, Luisa, you always arrive just as I’m leaving.”[4][76] — Massimo d’Azeglio, Italian statesman, novelist and painter (15 January 1866), seeing his estranged wife arrive at his bedside as he died

“I do not have to forgive my enemies. I have had them all shot.”[14][15] — Ramón María Narváez, 1st Duke of Valencia, Spanish general and Prime Minister of Spain (23 April 1868)

“My exit is the result of too many entrées.”[10]: 118 — Richard Monckton Milnes, 1st Baron Houghton, FRS, English poet and politician (11 August 1885)

“Damn. This is funny.”[13][24][15][167][168] — Doc Holliday, American gambler and gunfighter (8 November 1887), after a nurse refused him a whiskey

“My wallpaper and I are fighting a duel to the death. One or the other of us has to go.”[8]: 197 [73][160][190][191][192][193][note 110] — Oscar Wilde, Irish playwright (30 November 1900)

20th Century

“My last words to you, my son and successor, are: Never trust the Russians.”[3] — Abdur Rahman Khan, Emir of Afghanistan (1 October 1901), to Habibullah Khan

“On the contrary!”[2][12]: 25 [23][24] (“Tvertimod!”) — Henrik Ibsen, Norwegian playwright (23 May 1906), to his maid, who had said his health was improving

“I am dying. Please… bring me a toothpick.”[14][23] — Alfred Jarry, French symbolist writer (1 November 1907)

“I am about the extent of a tenth of a gnat’s eyebrow better.”[12]: 18 [17] — Joel Chandler Harris, American author and folklorist (3 July 1908), on being asked how he felt

“Ah, the cows…”[23] — Erik Satie, French composer and pianist (1 July 1925)

“If this is dying, then I don’t think much of it.”[12]: 33 [23] — Lytton Strachey, English writer and critic (21 January 1932)

“Never felt better.”[12]: 49 [22][23][35] — Douglas Fairbanks, American actor and filmmaker (12 December 1939), to an attendant who asked how he was

“I knew it! I knew it! Born in a hotel room and, goddamn it, dying in a hotel room.”[36]: 15 [43] — Eugene O’Neill, American playwright (27 November 1953), to his wife Carlotta Monterey

“I should have had the pickle.”[23] — Preston Sturges, American playwright, screenwriter and film director (6 August 1959)

“I done told you my last request … a bulletproof vest.”[282] — James W. Rodgers, American murderer (30 March 1960), facing a firing squad

“Remember, Honey, don’t forget what I told you. Put in my coffin a deck of cards, a mashie niblick, and a pretty blonde.”[3][39][43] — Chico Marx, American actor and comedian (11 October 1961), giving his wife Mary humorous instructions for his funeral

“I’d rather be skiing than doing this.” (when asked if he skied) “No, but I’d rather be doing that than doing this.”[12]: 40 — Stan Laurel, English actor, member of the duo Laurel and Hardy (23 February 1965), to a nurse

“Dying is a very dull, dreary affair. And my advice to you is to have nothing whatever to do with it.”[12]: 14 [17][23] — W. Somerset Maugham, English author (15 December 1965), to his nephew Robin Maugham

“Codeine… bourbon.”[3][12]: 41 [23][116][343] — Tallulah Bankhead, American actress (12 December 1968)

“If this is what viral pneumonia does to one, I really don’t think I shall bother to have it again.”[12]: 47 — Gladys Cooper, English actress (17 November 1971), looking in a mirror

“Damnit, don’t you dare ask God to help me!” — Joan Crawford, American actress (10 May 1977), directed towards her housekeeper who began to pray aloud.

“It must have been the coffee.”[43] — Jack Soo, American actor (11 January 1979); speaking to Hal Linden while being wheeled into operating room, referring to the bad coffee Soo’s character made on their sitcom Barney Miller

“Kill me if you want, but stop bothering me!” (“Tue-moi si tu veux mais arrête de m’emmerder”) — Paul Gégauff, French director (24 December 1983), before being killed by his Norwegian wife.

“Yeah, I think[428] I’d rather be fishing.”[12]: 60 [23][130][428] — Jimmy L. Glass, American convicted murderer (12 June 1987), prior to execution by electrocution[note 76]

“This dying is boring.”[43][note 77] — Richard Feynman, American theoretical physicist and raconteur (15 February 1988)

“I want the world to be filled with white fluffy duckies.”[43] — Derek Jarman, English film director, stage designer and author (19 February 1994)

“I did not get my Spaghetti-Os. I got spaghetti. I want the press to know this.”[2][23][43][130] — Thomas J. Grasso, American double murderer (20 March 1995), prior to execution by lethal injection

21st Century

“I should have been a concert pianist.”[34] — Edward Teller, Hungarian-American physicist (9 September 2003)

“Tape Seinfeld for me.”[10] — Harvey Korman, American actor and comedian (29 May 2008)

I probably missed some. You can start down the rabbit hole yourself here: https://en.wikipedia.org/wiki/List_of_last_words