Managing externally deleted resources in custom provider

I found the solution to my problem here:

func (r exampleResource) Read(ctx context.Context, req tfsdk.ReadResourceRequest, resp *tfsdk.ReadResourceResponse) {
  // ... other logic to call API/client ...

  if /* "resource not found" error */ {
    resp.State.RemoveResource()
    return
  }

  // ... other logic to update resp.State from API/client ...
}