When meditating, don't try to resist the thoughts or to get rid of them and calm down your mind. Let the thoughts be, observe them, observe your mind and don't engage.

Mind will calm itself down when you stop trying.