When to open one
A corrective action addresses the cause of a problem, not the problem itself. Reworking a defective batch is a treatment; changing the setup check that let the batch through is a corrective action. Open a CAPA when the same non-conformity could happen again.
The stages

Analysis. Record the root cause and how you arrived at it.
Action planning. Add the actions, each with an owner and a due date.
In progress. Owners complete their actions and record what they did.
Verification. Someone other than the action owner checks that the cause is actually gone.
Closure.
A CAPA cannot be closed while an action is still open, and an action cannot be completed before the CAPA is in progress. Both rules exist because a CAPA closed on paper is the single most common audit finding in this area.
Effectiveness
Verification asks one question: if the same conditions occurred again, would the same non-conformity occur? Answering it needs evidence from after the action was taken, which is why verification is a separate stage and not a checkbox.
Closing it
Closing is a decision, and the decision is written down. What you type here is what the next auditor reads when they ask why this CAPA stopped.

Next: find the root cause, which is where a CAPA that closes cleanly actually starts.