
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
In the Cartesian coordinate system $xOy$, it is known that vector $\overrightarrow{m}=(1,-1)$, $\overrightarrow{n}=(\sin x,\cos x)$, where $x\in(0, \frac{\pi}{2})$  
$(1)$ If $\overrightarrow{m}\perp\overrightarrow{n}$, find the value of $x$;  
$(2)$ If the angle between $\overrightarrow{m}$ and $\overrightarrow{n}$ is $\frac{\pi}{3}$, find the value of $x$.

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