How to make a script that only executes when NOT in "play"?

How do I create a script that executes only when the editor is not in play mode? Sort of like a plugin. Can someone help me out? Any help’s appreciated.