Modify templates with resources desployed

My query is, if I apply a deployment template for different resources in Azure and later someone with access and permissions manually deploys a resource, how can I update that template?

If I subsequently write that code in the template with the resource already created, when I make the plan and apply it does not detect that this resource already exists.

How would it be done in these cases?

Thanks for your help.