I don't know what to do

So my dog has started scratching at her ear but only at night when I'm asleep when I'm not able to stop her. She's dug so much that she's got an open wound on her ear. I don't know what to do aside from what I've been doing with Neosporin. Any suggestions?