
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
Let $z$ be a complex number with a positive real part, satisfying $|z|=2\sqrt{5}$, and the complex number $\left(1+2i\right)z$ is purely imaginary.  
$(1)$ Find the complex number $z$;  
$(2)$ If the complex number $z$ is a root of the equation $x^{2}+mx+n=0$ where $m$ and $n$ are real numbers, find the values of $m$ and $n$.

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