I was diagnosed with TMJ last year. Obviously cutting down on chewing and not chewing things that require you to open wide can help. I also saw a chiropractor and that that helped a lot.
Another thing I personally noticed was that when I would keep my mouth open, even a like a millimeter, it would greatly reduce the pain in my neck and jaw.
I think eventually you body subconsciously learns little tricks that help keep it under control, as I have noticed the pain in my neck has slowly gone down to where its only a rare occurrence now.
I know in extreme situations they can do surgery, but I hear that can do more harm than good.
Hope that helps.