Everything started in the 22nd century, when Doraemon (a faulty robot) was auctioned to a family suffering from abject poverty. This family, the posterity of Nobi Nobita, suffered dramatically all thanks to the debts which Nobi Nobita left behind to them as his legacy. Nobita's great great great grandson (correct me if I am wrong) decided that there wasn't a way out of this mess, and hence decided to send Doraemon back in time, to 250 years ago, to where Nobi Nobita lived, to help Nobita become a better person. This would ultimately change the future and improve the living conditions of Nobita's descendants.
Doraemon arrived in the year 1969, on the Japanese New Year. He popped out of Nobita's desk drawer, and from then on lived with Nobita, his mission was to prevent Nobita from becoming a failure. Each time Nobita was suffering from some kind of trouble, Doraemon would dig into his fourth dimensional pocket and use his myriad of gadgets to rectify the problem