How did Swaminarayan Bhagwan die? Did he take samadhi like Shri Ram or someone killed him like Shri Krishna?
Swaminarayan was not killed by anybody. He was aware of his death before it happened and he informed his departure to his followers. Before doing that, he appointed acharyas to continue his lineage.
Death and succession section of Swaminarayan's Wikipedia article says it clearly:
In 1830, Swaminarayan gathered his followers and announced his departure. He later died on 1 June 1830 (Jeth sud 10, Samvat 1886), and it is believed by followers that, at the time of his death, Swaminarayan left Earth for Akshardham, his abode. He was cremated according to Hindu rites at Lakshmi Wadi in Gadhada.
Wikipedia cites 'An Introduction to Swaminarayan Hinduism by Raymond Brady Williams' while giiving information about incidents from Swaminarayan's life.