When Abram asked God for children, God promised to give as many children as stars in sky, this promise was believed by Abram without any doubt. believing without any doubt was counted as Righteousness.
Sarai wife of Abram asked Abram to go in her maid servant by name Hagar to obtain children, Hagar conceived. After conceived Hagar despised sarai, Sarai dealt with Hagar heartily, Hagar escaped into the forest, there an angel of God appeared to her and said to return to sarai and be obedient to her. and you will give birth to a male child whose name should be Ishmael and God will bless Ismael also.
“ Abram believed God with any doubt and it is counted as Righteousness. It Apples to us also and will be bless like Abram.”
~ Genesis Chapter 15 and 16