is about all you need.
Well, posting the code that seems to need fixing would be a good idea.
The Arduino is sending data to the bluetooth device using an instance HardwareSerial or SoftwareSerial. Both have incoming and outgoing buffers. Which one are you thinking you need to flush? The outgoing serial buffer if emptied by using flush() (to wait until the data has been completely sent). "flushing" the incoming buffer means throwing away random amounts of unread data. While that can be done, I think it is such a stupid thing to do that I won't repeat the really simple code that does it. A little gray matter application will reveal that throwing away random amounts of unprocessed data is no different from actually processing the data, except that you don't actually do the processing.