@Crown
The answers given by TLDCAdmin and Diegocorry are correct.
How “ang” and “ng” are used and what they mean depend on whether the sentence has "no verb", or we are using a subject/actor-focus or an object-focus verb. When you can already identify the focus of the verb understanding “ang” and “ng” becomes easy.
Basically, it’s like this.
1. A) When the sentence has no Filipino verb in it, i.e., when the only verb used in the sentence is the English “to be” verb. (Filipino does not use the verb “to be”). B) When an actor/subject-focus verb is used:
ANG – precedes the common noun SUBJECT/ACTOR and translates to "the".
NG – a) translates to “of” to indicate “ownership” or b) indicates the object of the sentence.
Examples:
(1A) Maganda ANG babae. = ANG babae ay maganda. = THE woman is beautiful.
(1A and 1Aa) Maganda ANG damit NG babae. = ANG damit NG babae ay maganda. = THE dress OF the woman is beautiful.
(1B) Naglalakad ANG magandang babae. = ANG magandang babae ay naglalakad. = THE beautiful woman is walking.
(1Ba) Umiinom ANG aso NG magandang babae. = ANG aso NG magandang babae ay umiinom. = THE dog OF the beautiful woman is drinking.
(1Bb) Uminom ANG aso NG TUBIG. = ANG aso ay uminom NG TUBIG. = THE dog drank some WATER.
(1Ba Bb) Uminom ANG aso NG magandang babae NG TUBIG. = ANG aso NG magandang babae ay uminom NG TUBIG. = THE dog OF the beautiful woman drank some WATER.
The verbs used above, “maglakad” and “uminom”, are subject-focus verbs.
2. When an object-focus verb is used:
ANG – precedes the sentence’s OBJECT, which is now the SUBJECT of the sentence. It may also be translated to "the".
NG – indicates the ACTOR of the verb.
“Lakarin (nilakad, nilalakad, lalakarin)” and “inumin” are the equivalent object-focus verb forms of “maglakad” and “uminom”.
Note that a sentence that uses an object-focus verb must have an object.
Nilakad NG magandang babae ANG isang milya. = ANG isang MILYA ay nilakad NG magandang babae. = A/THE MILE was walked BY the beautiful woman. (This is the literal translation, but to us Filipinos, we simply understand this as “The beautiful woman walked a mile”.)
Ininom NG aso ANG TUBIG. = ANG TUBIG ay ininom NG aso. = THE/SOME WATER was drunk BY the dog. (We also just understand this to mean, “The dog drank some water”.)