Ein/eine in German
How do you know when to say ein or eine?
articles (and most other things in German) depend on case and grammatical gender.
The gender of each noun is a grammatical category that has nothing to do with actual gender. Some words are masculine words, some are feminine words, and some are neuter.
For your example, you would say
Ein Junge (because Junge is a masculine word)
Eine Frau (because Frau is a feminine word)
Ein Mädchen (because Mädchen is a neutral word)
It gets more complex than just that, but for now you'll have to try and memorise the grammatical gender for each noun that you learn.
It depends on what you are talking about for example:
Ein Mann Eine Frau
The reason for ein is because it’s der Mann And eine Frau because it’s die Frau
Every word will have a gender: das, die or der
And it works that way because of the cases:
In German there are 4 Cases:
Nominative Accusative Dative Genitive
It is hard to get to grips with it but practice defiantly helps, I go to a private German teacher and it helped me get better at it,