To answer your question it sounds like you have experienced a posterior vitreous
You have a thick gel material in the middle of your eyes called the vitreous. Over time as it liquefies, this gel material collapses on itself, forms little clumps that you can see as dots, lines or bugs. As these clumps form the vitreous pulls away from the wall of the eye. In the process it can stimulate the retina -- causing the flashes that you may see.
It is recommended that you see your ophthalmologist to look at the retina to make sure there are no problems such as a retinal hole or tear. In most cases, there are no problems, but this exam is precautionary and allows for preventative treatment of any lesions that are found.
If you notice a sudden increase in floaters, flashes of light (like a lightning storm), or a shadow/veil in the periphery of your vision, this can be worrisome for a retinal detachment. You would need to contact your ophthalmologist promptly in that case.
What can you do about the floaters? Well, floaters don't go away, and they don't really get worse. Over time they tend to "sink" out of your central vision and you brain "filters" them out so you don't notice them so much anymore. They almost never cause significant visual problems except, of course, if they cause a secondary retinal detachment as discussed above. The only way to decrease or remove the floaters is with a major surgery called a vitrectomy. As a retinal specialist for almost 2 decades I've only done this procedure to remove floaters in a handful of cases.
Here is a video of the actual surgery to remove floaters:
Does this make sense to you?
Please remember the top 3 ratings are positives [Excellent service is my goal] and this is how we are compensated. Rate my answer when you are satisfied. If you feel the need to rate low, please stop and reply to me via the REPLY TO EXPERT button with the issue you have. I will be happy to continue further and do everything I can to provide you with the service you seek.
Otherwise, a high positive rating is very much appreciated, bonuses are great, and find me anytime for follow up.
Let me know if you have further questions.