From the Mahaparinibbana Sutta:
And the Blessed One addressed the bhikkhus, saying: "Behold now, bhikkhus, I exhort you: All compounded things are subject to vanish. Strive with earnestness!"
This was the last word of the Tathagata.
The footnote states:
Handa dani bhikkhave amantayami vo: Vayadhamma sankhara appamadena sampadetha. Earnestness (appamada) is explained as "presence of mindfulness." Comy.: "'You should accomplish all your duties without allowing mindfulness to lapse!' Thus did the Blessed One, while on the bed of his Parinibbana, summarize in that one word on earnestness the advice he had given through forty-five years."
And from another translation:
Then the Gracious One addressed the monks, saying: “Come now, monks, for I tell you all conditioned things are subject to decay, strive on with heedfulness!” These were the last words of the Realised One.
Regarding the alleged poisoning, you can read it here from the same sutta.
As ruben2020's answer says, the Mahaparinibbana Sutta (DN 16) -- "the great discourse on the Buddha's extinguishment" -- is the sutta which contains the account of the Buddha's passing.
Here's the bit about his being poisoned -- On Cunda the Smith. That seems to have been an accident, i.e. food poisoning, not deliberate. The Buddha later tells Cunda to have no remorse, that Cunda is fortunate to have given a meal to the Buddha. Also by the way some people dispute that the meal was "pork" and say that the better translation is "food for pigs" or "pig mushrooms".
As for the last statement,
vayadhammā saṅkhārā appamādena sampādethā
Ven. Sujato translates that:
Conditions fall apart. Persist with diligence.
Jayarava posted an essay to analyse or explore the ranges of meanings of the words -- The last words of the Buddha -- which concludes with his translating it like this:
Bringing all of this information together we can now attempt a translation of the phrase, the Buddha's sacred last words:
All compounded things, all experiences (mental and physical), all phenomena by their very nature decay and die, and are disappointing: it is through being not-blind-drunk on, obsessed by, or infatuated with, the objects of the senses that you succeed in awakening, or obtain liberation.
Or more succinctly:
All things are disappointing, [it is] through vigilance [that] you succeed.