On the same day (4th July 1902) Swami Vivekananda attained Mahasamadhi upon his own will, but his words are immortal that he still inspires all through them.
Given below are details about his Mahasamadhi:
A week before the end, Vivekananda asked Shuddhananda to bring him the Bengali almanac. Swamiji turned several pages and then kept it in his room. He was seen several times on subsequent days studying the almanac intently, as if looking for something auspicious. … Three days before his passing away, while walking on the spacious lawn of the monastery with Premananda, Swamiji said to him, pointing to a particular spot on the bank of the Ganges: “When I give up the body, cremate it there”. Today on that spot stands a temple in his honour.
Sister Nivedita wrote: “When June closed … he knew well enough that the end was near. “I am making ready for death!” – he said to one, who was with him, on the Wednesday before he died: “A great tapasya (austerity) and meditation has come upon me, I am making ready for death”.
Once in Kashmir, after an attack of illness, I had seen him lift a couple of pebbles, saying: “Whenever death approaches me, all weakness vanishes. I have neither fear, nor doubt, nor thought of the external. I simply busy myself making ready to die. I am as hard as that” – and the stones struck one another in his hand: “for I have touched the feet of God!” …
On Wednesday (2 July) of the same week, the day being Ekadashi, and himself keeping the fast in all strictness, he insisted on serving the morning (noon) meal to the same disciple (Nivedita). Each dish as it was offered – boiled seeds of the jackfruit, boiled potatoes, plain rice, and ice-cold milk – formed the subject of playful chat; and finally, to end the meal, he himself poured the water over the hands and dried them with a towel.
“It is I, who should do these things for you, Swamiji! Not you for me!” – was the protest naturally offered. But his answer was startling in its solemnity: “Jesus washed the feet of his disciples”. Something checked the answer: “But it was the last time!” – as it rose to the lips, and the words remained unuttered”.
On his last day, Friday, 4 July 1902, Vivekananda got up very early in the morning as usual and went to the shrine for meditation. He was not sick at all. During breakfast he was in a jovial mood, teasing Premananda and recalling many events of olden times. He had fruit, milk and tea. …
At 8:00 a.m. he again entered the shrine for meditation. When at 9:30 a.m. Premananda entered the shrine to perform the daily worship, Swamiji asked him to carry his asana (carpet) to the Master’s bedroom, which was adjacent to the shrine, and shut all doors and windows. Swamiji dusted the Master’s bed with his own hand, and again sat for meditation. Never before he performed such meditation in the monastery. What transpired there, no one knows. He finished his meditation at 11:00 a.m., and then began to sing a song about Kali in his sweet voice which the monks heard from downstairs. …
Descending the stairs of the shrine, he walked back and forth in the courtyard of the monastery. He appeared indrawn, as if travelling to a distant land. Suddenly Swamiji said to himself: “If there were another Vivekananda, then he would have understood what this Vivekananda has done! And yet – how many Vivekanandas shall be born in time!” His statement was overheard by Premananda, who was standing on the veranda of the chapel. Never before had Swamiji spoken like this.
Then he expressed a desire to worship Mother Kali at the monastery the following day. …
At noon he heartily enjoyed his lunch with the monks in the dining room. Because of his illness, he had generally taken his meals in his room. … He talked awhile and then went to his room to rest. After fifteen minutes he came out of his room and told Premananda: “Let us go and study. Day sleep is not good for a monk. Today I did not get any sleep”. … He went to the library and called the brahmacharins to attend the class on Sanskrit grammar. One who attended this class wrote: “The class lasted for nearly three hours. But no monotony was felt. … He, however, appeared a little tired after grammar class”.
Swamiji wanted each disciple to be original and not to follow him blindly. Warning against false prophets, who might come in the future, he said to the boys: “If any man ever imitates me, kick him out. Do not imitate me”.
At 4:30 p.m. … he went for a walk with Premananda to Belur bazaar, one mile away. …
At 5:30 p.m. he returned to the monastery from his walk. He sat on a bench under the mango tree and said: “My health is so good today, which I have not felt for a long time”. Swamiji talked to Premananda and other monks about the history of European civilization and also colonial history. “India is immortal”, - he said: “if she persists in her search for God. But if she goes in for politics and social conflict, she will die”. …
At 6:30 p.m. when he found that some monks were taking tea, he went to them and said: “Will you give me a cup of tea?” He enjoyed the tea with them. When the vesper bell was rung at 7:00, he got up and went to his room upstairs. … Entering his room, Swamiji said to his attendant Brahmachari Brajendra: “My body is very light today. I feel fine. Please give me my rosary”. He sat facing the Ganges. Before he began his meditation, he asked Brajendra to go to the other room, and instructed him: “Wait and meditate till I call you”. After an hour, at 8:00, the swami called Brajendra and asked him to fan his head. Swamiji told him to open all the windows of his room, because he was feeling hot. Then, he laid himself down on his bed on the floor. He still had the rosary in his hand. After a while Swamiji said to him: “All right, no more need for fanning! It would be better if you give a little massage to my feet”. Soon, he seemed to fall asleep, and one hour passed in this manner. Vivekananda was lying on his left side and the brahmacharin was massaging his feet. He then moved and lay down on his back; shortly after that, he cried out like a baby cries for its mother. Towards the end, Brajendra noticed that Swamiji’s right hand trembled a little, there was perspiration on his forehead, he breathed a deep breath, and his head rolled down by the pillow. There was silence for a minute or two, and again he breathed in the same manner; his body became still. It was 9:10 p.m. … Vivekananda passed away at the age of thirty-nine years … thus fulfilling his own prophecy: “I shall never see forty”.
In the beginning of his mission Vivekananda had said: “I am a voice without a form”. Towards the end, he said: “It may be that I shall find it good to get outside of my body – to cast it off like a disused garment. But I shall not cease to work! I shall inspire men everywhere, until the world shall know that it is One with God”.
(“Swami Vivekananda – A Biography: By His Eastern and Western Disciples”, Advaita Ashrama, April 1960, Mahasamadhi)