If neuroscience is believed, then in our mind, a delete button is found to remove information like a computer. In Neurology, it is called Neuro Circuit. Yes, according to scientists, there is also a circuit in our mind, with the help of which bad memories can be removed. However, this button can only come under control after practice.
You know that any person or animal has to practice so much to make it perfect. This is just the case with this mindset of the brain. For example, whenever we learn to play a new thing or new tool, this neuro circuit in our brain secures its pattern. Now if you have to remove that memory then this circuit will have to work in the opposite direction.
Even though the mind itself keeps shedding old memories from time to time. But this delete button can erase many memories together. The ability to forget an old phenomenon of the brain is called synaptic pruning. Often, when we sleep, the brain removes those old memories which we have not used for a long time.