Question: Is it important to say Shema before going to bed or is it sufficient just to say it during maariv? Is it better to skip saying hamapil if I know I am likely to talk?
Answer: The Shulchan Aruch (OC 239:1) writes that one should say the first paragraph of Shema, various pesukim and the beracha of hamapil before going to bed (see Gemara Berachos 60b).
The Mishna Berura (239:1) writes that it is ideal to say all three paragraphs. Certainly, one who davened maariv before nacht must repeat all three paragraphs now.
While minhag ashkenaz is to recite the Shema before hamapil, sefardim say hamapil first (See Yalkut Yosef 239:1).
The Rema (OC 239:1) writes that one should not talk or eat afterwards. R’ Ovadia Yosef (Yechave Daas 4:21; Yalkut Yosef 239:1) allows one to say asher yatzar, shehakol on a drink, quieten a child or respond to one’s parents after hamapil (See Mishna Berura 239:4; Piskei Teshuvos 239:3; Tefilla Kehilchasa p352, n29).
R’ Eliezer Waldenberg (Tzitz Eliezer 7:27:3) writes that one doesn’t need to worry about not talking after the beracha. Nonetheless, the Ben Ish Chai (Pekudei 12) writes that if one feels that they won’t fall asleep straight away and is going to talk, one should say the beracha without Hashem’s name at the beginning and end.The Mishna Berura (239:9) writes that it is good to reflect on one’s actions during the day before sleeping, committing not to repeat any mistakes that one may have done and to forgive others’ wrongdoings against them.