Prevent users from deleting an Account that still has at least one open Opportunity (IsClosed = false).
Write a before delete trigger that calls addError('Cannot delete an account with open opportunities') on each offending record in Trigger.old. Other accounts in the same batch must still be deleted.
Use one aggregate or semi-join query per chunk — the test deletes 300 accounts at once.
record.addError(message) — throwing an exception would fail the whole batch.