The Shulchan Aruch · Orach Chayim
אורח חיים כ״חOrach Chayim 28
Siman 28 of 697 in Orach Chayim — 3 se'ifim
הלכות תפיליןLaws of Tefillin· siman 28
Se’if 1א׳
חַיָּב אָדָם לְמַשְׁמֵשׁ בַּתְּפִלִּין בְּכָל שָׁעָה שֶׁלֹּא יַסִיחַ דַּעְתּוֹ מֵהֶם, וִימַשְׁמֵשׁ בְּשֶׁל יָד תְּחִלָּה, וּכְשֶׁיֹּאמַר וּקְשַׁרְתָּם לְאוֹת עַל יָדֶךָ יְמַשְׁמֵשׁ בְּשֶׁל יָד, וּכְשֶׁיֹּאמַר וְהָיוּ לְטֹטָפֹת בֵּין עֵינֶיךָ יְמַשְׁמֵשׁ בְּשֶׁל רֹאשׁ.
...A person should regularly touch his tefillin so that he should not become distracted from them. When doing so he should touch his shel yad first. When reading the words ” וקשרתם לאות על ידך ” he should touch his shel yad and when he reads לטטפת בין עיניך ” ” he should touch his shel rosh.
Se’if 2ב׳
תְּפִלִּין שֶׁל רֹאשׁ חוֹלֵץ תְּחִלָּה מִשּׁוּם דִּכְתִּיב וְהָיוּ לְטֹטָפֹת בֵּין עֵינֶיךָ כָּל זְמַן שֶׁבֵּין עֵינֶיךָ יִהְיוּ שְׁתַּיִם. צָרִיךְ לַחֲלֹץ תְּפִלִּין שֶׁל רֹאשׁ מְעֻמָּד יָנִיחַ בָּתִיק שֶׁל רֹאשׁ, וְעָלָיו שֶׁל יָד, כְּדֵי שֶׁכְּשֶׁיָּבֹא לַהֲנִיחָם יִפְגַּע בְּשֶׁל יָד תְּחִלָּה.
...One should remove his shel rosh first since the words והיו לטטפת בין עיניך ” ” indicate that when wearing the shel rosh one should have them both (the shel yad and the shel rosh) on his body. The shel rosh should be removed while standing. One should place the shel yad in the tefillin bag on the shel rosh so that when he reaches in the bag he will touch the shel yad first.
Se’if 3ג׳
מִנְהַג הַחֲכָמִים לְנַשֵּׁק הַתְּפִלִּין בִּשְׁעַת הֲנָחָתָן וּבִשְׁעַת חֲלִיצָתָן:
...The custom of scholars is to kiss their tefillin when putting them on and taking them off.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0