Grinding my teeth in my sleep. How to prevent this?

Can't prevent it. You can prevent damage caused by grinding by wearing a night guard. Once you learn to grind to deal with stress you are gonna keep doing it.