TMS can work when antidepressants have not and has fewer side effects than most medications. This treatment treats depression and obsessive compulsive disorder (OCD) by using magnets to activate the brain. Read more about TMS, also called transcranial magnetic stimulation.