Siman 81
Presented here for study, not as a practical ruling. The Shulchan Aruch rules by Sephardi custom, the Rema's glosses by Ashkenazi custom, and the Kitzur follows Ashkenazi custom. For a practical question, ask your rabbi.
א קָטָן שֶׁהִגִּיעַ לִכְלַל שֶׁאַחֵר כַּיּוֹצֵא בּוֹ יָכוֹל לֶאֱכֹל כַּזַּיִת דָּגָן, בִּכְדֵי שֶׁיָּכוֹל גָּדוֹל לֶאֱכֹל אֲכִילַת פְּרָס, מַרְחִיקִין מִצּוֹאָתוֹ אוֹ מִמֵּימֵי רַגְלָיו.
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.
ב הָיָה קוֹרֵא וְרָאָה צוֹאָה כְּנֶגְדּוֹ, יֵלֵךְ כְּדֵי שֶׁיִּזְרְקֶנָּה מֵאַחֲרָיו אַרְבַּע אַמּוֹת. וְאִם אִי אֶפְשָׁר, כְּגוֹן שֶׁיֵּשׁ לְפָנָיו נָהָר אוֹ דָּבָר אַחֵר הַמְעַכֵּב, יֵלֵךְ כְּדֵי שֶׁיַּנִּיחֶנָּה לַצְּדָדִין ד' אַמּוֹת, וְאֵינוֹ צָרִיךְ לַחֲזֹר אֶלָּא לַמָּקוֹם שֶׁפָּסַק. ולה "ר יוֹנָה אִם הָיָה בְּמָקוֹם שֶׁהָיָה לוֹ לָתֵת אֶל לִבּוֹ שֶׁיֵּשׁ שָׁם צוֹאָה, צָרִיךְ לַחֲזֹר לְרֹאשׁ: וְעַיֵּן לְעֵיל סי' ע"ו סָעִיף ח':
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)