There is a rough rule of thumb: use Imperfective verbs with negation:
Pf. Ћн взїл моє кнќгу. He took my book.
Impf. Ћн не брђл моє кнќгу. He didn't take my book.
Pf. Ктћ взїл моє кнќгу? Who took my book?
Impf. Ї не брђл. I didn't take it.
The above rule is not a grammatical restriction; it has more to do with real life and the fact that we usually want to convey the idea that we did not even start, did not even attempt the action. For that reason, the following statements naturally require an Imperfective verb: I didn't call him, They didn't have a vacation this year, We haven't eaten since Friday. If the intent is to convey that fact that an action was attempted, but failed, then Perfective is a more natural choice:
Pf. Онђ не решќла задђчу. She didn't solve the problem. (She was supposed to, but she didn't; maybe she tried and failed.)
Impf. Онђ не решђла задђчу. She didn't work on the problem. (She didn't even try.)