Can we get rid of unwanted thoughts?
It is literally impossible to do so. The reason is because thoughts are something that appears out from nowhere (we cannot pinpoint where it comes from). All we know is it comes from our mind.
If you cannot know where your thoughts are, how can you prevent it from surfacing?