D5 move closing my bishop activity I would like to know why playing d5 in these two positions is useful for me (Black).
You do not have enough control of e4, and if white gets to play e4-e5 here, your king is a goner. It is an absolute must here to stop that plan, and the only way to do it is d5. Making your Bb7 bad for now pales in comparison to letting your king get mated, or loss of significant material, which will happen after e4-e5.