
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 an ellipse $C$ with its center at the origin and its foci on the $x$-axis, the focal distance is $4$, and the eccentricity is $\dfrac{\sqrt{2}}{2}$.
$(1)$ Find the equation of the ellipse $C$;
$(2)$ Given a line $l$ passing through point $P(0,-1)$ and intersecting the ellipse at points $A$ and $B$. If $\overrightarrow{AP}=2\overrightarrow{PB}$, find the equation of line $l$.

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