Trouble with German
I am having trouble understanding the difference between ein and eine
Bing a German native speaker I luckily never had to learn these myself, but a friend of mine who learns German told me there are several "hints" in the word endings. They are rule of thumbs rather than explicit rules, and frankly I never realized before he told me, but it is interesting - here are some examples http://www.lsa.umich.edu/german/hmr/grammatik/Gender/Gender.html
The above answer is spot on, but I think it would be unwise to dwell to much on it because its hard to get a sense of when to use each one until you have listened to a lot of spoken German. Noun gender doesn't exist in English (anymore that is, we managed to drop it at some stage), but it still sounds very jarring if you say 'a apple' or 'an table', and that is a similar sort of thing. I don't even personally think of noun gender as 'gender' because aside from humans and animals, it makes no logical sense to assign male or female qualities to an inanimate object like a table, and trying to understand why just brings out too many aimless unsolvable questions... The upshot is that not knowing which is which wont stop you from communicating, but will mark you as not a fully fluent speaker.
Essentially you just have to remember which one to use when, which frankly can be very frustrating at first, but becomes more and more like 'common sense' the more immersed you become in German. That is because A: there are some patterns and B: if you hear it enough times, it just feels right when you say it. Obviously you can refer to grammar explanations as well, but I think it is more pragmatic just to read and listen loads and just try and match how native Germans speak, and your brain will get the added benefit of you having forced it to work on reading and listening.
Unfortunately foreign learners don't have the luxury of mum and dad to constantly correct you until you get it right, but this is exactly what Duolingo could potentially amazingly handy for. It already it gives you instant feedback as soon as you use it, and it's never too busy to do so. Would it not be amazing if you were able to type your own phrases into Duolingo, and have it point out mistakes? This is actually a handy trick I often use plain google web search for: I type what I think I would say, and see if my phrase appears written by native speakers. It may not be very elegant, but it is certainly very reassuring :)