I have been learning Russian for a year now. I took a trip to somewhere where there are many Russian speaking peoples. I realized that I use мойи моя incorrectly. Can someone please help me.
The difference is in grammatical gender.
Мой is used for masculine objects:
мой дом, мой планшет, мой любимый (мужчина).
Моя is used for feminine objects:
моя машина, моя сеть, моя любимая (женщина).
You haven't mentioned but as there are three genders in Russian language there is also моё that is used for neuter gender objects:
моё окно, моё видение.
P.S.: As you may have noticed all of them are used for animate and inanimate objects.