Google Sheets Function: COUNTIFS
The COUNTIFS function counts the number of cells that meet multiple criteria (unlike the COUNTIF function, which is limited to a single criterion).
Usage:
=COUNTIFS(criteria_range1, criterion1)
or
=COUNTIFS(criteria_range1, criterion1, criteria_range2, criterion2, ...)
Usage Example
The COUNTIFS function will be used here to first calculate the number of unpaid invoices (= 1 criterion) and then the number of unpaid and overdue invoices (= 2 criteria):

Enter the COUNTIFS function:
- criteria_range1: the range to compare with criterion1 (here, the "Paid" column)
- criterion1: the test
""to check if the cell is empty
The formula here is:
=COUNTIFS(C2:C11,"")

Since there is only one criterion, the use of the COUNTIF function is also suitable.
To now obtain the number of unpaid and overdue invoices, add a second criterion to the formula that checks if the payment deadline is passed (so smaller than TODAY):
=COUNTIFS(C2:C11,"",B2:B11,"<"&TODAY())

If needed, you can copy the Google Sheets document (or view the document) with this example.
Tip: it is possible to use wildcard characters with this function.