
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Given a complex number $z=(m^{2}+m-2)+(m^{2}-1)i$ where $m\in \mathbb{R}$, find the values of the real number $m$ for which the complex number $z$ is:<br/>$(1)$ a real number;<br/>$(2)$ a purely imaginary number.

Present the answer in LaTex format: \boxed{Your answer}
user