A student of mine was in her lesson, and I asked about an exercise she had for homework. She answered, "it didn't go so well." "How so?" I asked. "I just didn't get it. It didn't make sense to me." I said, "We went over it before you left last week, and you seemed to be ok with it. What was different at home?" She was a little flustered, "I don't know. It seemed so much easier when I was here, and then I got home and couldn't remember what we did." We tried playing it just to see how it would go, and she struggled to make sense of it.
Then came the kicker: "What did we do last week before we played this exercise?" A pause for thought, then she asked "Did we count it?" "We did! Out loud. And I remember that you figured most of it out on your own - I just helped every now and then. So, now the question is, did you count it at home?"
You can probably guess the answer. But, why should counting out loud help? Well, for starters, it takes a complex task and breaks it down. Melody (the tune you play) has a two-fold foundation: pitch (how high or low) and rhythm (how long or short). Take away the pitch, and you no longer have melody. Take away rhythm, and you still don't have melody. They are both equally important. When you count out loud, you're just focusing on the rhythm and your brain gets a chance to figure out one of the two pillars of the melody you're trying to play. Second, when you count out loud, you get the benefit of hearing how the rhythm sounds from your own voice. That hearing either reinforces or corrects your concept of the rhythm. Then, you can match what you play to what you've just counted.
Try it at home. Count in a quiet voice before you play a tricky section of your music. Use numbers (one-and two, three-and four), not an ambiguous syllable (dun-dun duh, dun-dun duh). The numbers are more concrete and will help you correctly place those notes in the measure and keep them proportionate to other notes. Go through and figure the rhythm out, then go back and count it in rhythm. Tapping your foot to keep track of the steady beat is helpful.
Take the time to do it yourself. You don't have to depend on the student next to you in class to play it first, or for your teacher to sing it to you. If you can count it correctly with your voice, you're much more likely to play it correctly with your instrument. It will take some work, but you can do it for yourself.