Wouldn't you know it, (sentence)
Use this phrase when something really inconvenient – maybe the most inconvenient thing in that situation — happens.
For example, if you drove 30 minutes to a library in order to check out a specific book, but the book was already check out, you'd say:
Wouldn't you know it, it was checked out!
The tone of "Wouldn't you know it" is disappointed but accepting, like you're thinking that inconvenient things always happen to you.