Depending on what instrument you play, here's another tip:
First, without your instrument, make sure you are able to tap along with the metronome with your foot.
Then, whenever you play, you always keep said foot tapping (whether you are using the metronome or not, or playing with a drummer/band/orchestra, just always).
Now, at the very beginning (but only at the very beginning) this will make it a little harder to keep time, since you now have a foot to worry about too. But before you know it this foot will become your anchor, the very thing that keeps you in time, always. You will notice that whenever you play along with something, you will naturally start with tapping your foot, even before you play a single note.
Eventually, you will learn to "mentally" tap your foot, without even moving it. That's when you will have (as mentioned by others) internalized the beat.
Also, if you are still having trouble keeping time in general, it pays to tap your foot (discreetly) whenever you hear music, whether you are playing or not. And dance, if you're so inclined, dancing is an awesome way to get a feel for the beat.
Lastly, don't feel bad about not getting it right the first time, we all had to learn this. Some might have learned it so young that they forgot they ever did, but I only learned to keep time (properly) in my early twenties and specifically remember being very frustrated by it, just like you are now. Nowadays it's second nature to me, not because of talent, but simply because I practiced the above. Hang in there, it'll get better!
P.S. This is not specifically a beginner technique, take a look a their feet whenever you see musicians playing, you'll see what I mean.