Praise be to Allah
So long as you do not remember breaking the fast in Ramadan, this doubt that has occurred to you is waswasah (whispers) from the Shaytan, and you do not have to do anything. The scholars have mentioned a principle which states that if the Muslim does an act of worship, then after he finishes it, he is uncertain as to whether he did it correctly or not, then he should not pay any attention to this doubt, and his act of worship is valid.
Al-Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) said:
This principle is very important. Uncertainty after completing an act of worship does not affect the act of worship. For some people, when they have finished praying and said the salam (salutation for ending prayer), the Shaytan comes to them and says: You did not recite al-Fatihah, you only prostrated once. Uncertainty in this case should be ignored, because uncertainty after completing an act of worship does not affect it.
Many people face a great deal of uncertainty and can hardly do any act of worship without feeling uncertain. This uncertainty should also be ignored and no attention should be paid to it, because it is a kind of waswas. End quote.
Duroos wa Fatawa al-Haram al-Madani, p. 153
Based on that, if the Shaytan comes and whispers to you that you broke the fast, do not pay any attention to this uncertainty and do not focus on thinking about it.
One of the anecdotes that was mentioned concerning that is what was said by Ibn al-Jawzi (may Allah have mercy on him):
We have heard that a man came to Abu Hazim and said to him: The Shaytan comes to me and says: You have divorced your wife, and he makes me uncertain. He said to him: Did you not divorce her? He said: No. He said: Did you not come to me yesterday and divorce her in my presence? He said: By Allah, I only came to you today and I did not divorce her in any way whatsoever. He said: Swear to the Shaytan that if he comes to you as you have sworn to me, you will be fine. End quote.
Al-Adhkiya, p. 31
The best remedy for this waswas is to remember Allah a great deal, call upon Him in du‘a (supplication) and seek refuge with Him from the Shaytan. Then after that, ignore this waswas and do not pay any attention to it. It is essential to put a stop to these thoughts and not get carried away with them. Even though this is difficult to do, it is the remedy.
For more information please see the answer to question number 62839
And Allah knows best.