If I forget that I am fasting and I eat something during the day of Ramadan, what shall I do?
All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Whoever forgets and eats or drinks something while fasting, he should complete his fast and he is not required to make up this day as the Prophet said: “Whoever forgets he is fasting and eats or drinks should complete his fast as it was Allah who fed him and gave him something to drink”. [Al-Bukhaari Muslim]
This is the opinion of the majority of the scholars . Imaams Ad-Daraaqutni, Ibn Hibbaan and Ibn Khuzaymah mentioned in their narration that the making up of the fast is not compulsory “…he does not have to make up the fast.”
This applies to both the obligatory and optional fasting.
Allah knows best.
You can search for fatwa through many choices