The Shulchan Aruch · Orach Chayim
אורח חיים פ״אOrach Chayim 81
Siman 81 of 697 in Orach Chayim — 2 se'ifim
הלכות קריאת שמעLaws of Reciting Shema· siman 81
Se’if 1א׳
קָטָן שֶׁהִגִּיעַ לִכְלַל שֶׁאַחֵר כַּיּוֹצֵא בּוֹ יָכוֹל לֶאֱכֹל כַּזַּיִת דָּגָן, בִּכְדֵי שֶׁיָּכוֹל גָּדוֹל לֶאֱכֹל אֲכִילַת פְּרָס, מַרְחִיקִין מִצּוֹאָתוֹ אוֹ מִמֵּימֵי רַגְלָיו.
Laws of the Excrement of a Child, containing 2 s'ifim A child who has arrived at [an age that] generally other [children] similar to him can eat an olive-size amount of grain in [span of time] that an adult could eat a half-loaf, we distance ourselves from his excrement or urine.
Se’if 2ב׳
הָיָה קוֹרֵא וְרָאָה צוֹאָה כְּנֶגְדּוֹ, יֵלֵךְ כְּדֵי שֶׁיִּזְרְקֶנָּה מֵאַחֲרָיו אַרְבַּע אַמּוֹת. וְאִם אִי אֶפְשָׁר, כְּגוֹן שֶׁיֵּשׁ לְפָנָיו נָהָר אוֹ דָּבָר אַחֵר הַמְעַכֵּב, יֵלֵךְ כְּדֵי שֶׁיַּנִּיחֶנָּה לַצְּדָדִין ד' אַמּוֹת, וְאֵינוֹ צָרִיךְ לַחֲזֹר אֶלָּא לַמָּקוֹם שֶׁפָּסַק. ולה "ר יוֹנָה אִם הָיָה בְּמָקוֹם שֶׁהָיָה לוֹ לָתֵת אֶל לִבּוֹ שֶׁיֵּשׁ שָׁם צוֹאָה, צָרִיךְ לַחֲזֹר לְרֹאשׁ: וְעַיֵּן לְעֵיל סי' ע"ו סָעִיף ח':
If one was reciting [the Sh'ma], and saw excrement in front of them, they should go such that they put it behind them by 4 amot. And if that is not possible, for example, there is a river or another thing that prevents [going], they should go such that they place it 4 amot to the side. And one does not have to go back [and recite from the beginning] rather to the place they stopped. And according to Rabbeinu Yonah, if one was in a place where they should have given attention to [the fact] that there is excrement there, they need to go back to the beginning (And see above Siman 76, se'if 8)
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0