Fasting is a special offer for Muslims to get high rewards from Allah. In fasting, Muslims abstain from eating even halal food and halal relationship from sunrise (sahoor) to sunset (Iftaar).
Fasting is actually the only matter of a person to his Allah. Fasting totally depends on the intention and only Allah knows the intention. As Allah says in Hadith Qudsi:
Fasting is for me and I shall reward for it.
If any Muslim eat anything during Fast, his fast will break. But if he eat something by mistake because he forget his fast, then his Fast will not break because he did not intend for it to break. Allah never asks for an act which is performed by mistake. But a man is always accountable for his action which he has done intentionally. If someone eats intentionally during his fast then his fast will break and he will be accountable for his fast breaking. He will have to pay fidya and beg forgiveness. If someone eats during Fast by mistake, his fast remains valid. He should continue his Fast because Allah says in Quran:
And there is no sin on you if you make a mistake therein, except in regard to what your heart deliberately intends. And Allah is Ever Oft-forgiving, Most Merciful.(Al-Ahzaab 33:5)
So make your intentions pure for Allah as much as possible. Try to do more and more ibadaat during Fast. Try to perform all duties honestly. So that, Allah bless you with all the special blessings of Ramadan.