You need to distract your mind from such thoughts. Do some creative work
What kind of thoughts have you been getting?
I get some thoughts that " "what will happen if I enter an iron nail in the tip of my penis and what will happen If i cut my penis etc etc. I know that these thoughts are totally meaningless but I can 't resist these thoughts because if i try to resists it comes more to my mind.And,It forces me to think about it whole day due to which i cannot concentrate on my studies and often become sad and depressed
these thoughts are baseless, why will that happen. Read some good book and avoid violent movies or anything that you watch.
I know these thoughts are baseless but don't know why it comes to mind all the time,and irritates me a lot.