Hello Katie
Rule: "whom" is to "him" as "who" is to "he":
1. Who likes grammar? He likes grammar.
2. Whom does she prefer? She prefers him.
Now take your sentence:
3. I don't know who(m) to ask.
(I've put the "m" in brackets, to show that we haven't yet decided whether it should be "who" or "whom".)
The underlined part in #3 is the question, i.e. the thing you don't know the answer to:
4. Who(m) should I ask?
To which the answer might be:
5. You should ask him.
If we look at the "rule" above, we see "whom" = "him". So in your sentence, since you have "him" in the answer, you can have "whom" in the question, i.e.
6. I don't know whom to ask.
That said...I never use "whom" myself, in a question.
MrP