I. Sanctity and Preparations
Convenience can easily override sanctity unless we take care to preserve it. The items we use as tools in our worship attain a measure of sanctity. Must we treat them specially to maintain their status? More specifically, may someone who normally wears a hat and/or jacket to pray take those items into the bathroom?
It is a mitzvah to use the bathroom before praying. The prophet exhorts us to “Prepare to meet your God, Israel” (Amos 4:12), which the Talmud asserts includes relieving ourselves if we so need (Berakhos 23a). Efficiency and convenience would presumably require someone on his way to prayers to take with him his hat and/or jacket to avoid doubling back to retrieve them. Is this allowed?
II. Designated Clothing
There are, I believe, two issues involved. The first is defining the sanctity, if any, a hat and/or jacket attain. The Taz (Orach Chaim 21:3) rules that any item that is dedicated for use during prayer has the status of tashmishei mitzvah and therefore may not be taken into a bathroom. Men wear the four-cornered garment we call “tzitzis” all day and may enter a bathroom while wearing it. They wear a tallis, on the other hand, only during prayer and must therefore remove it before going into the facilites.
Nevertheless, the Taz (Yoreh De’ah 283:3) himself and the Shakh (Yoreh De’ah (283:6) explicitly permit wearing a tallis into a bathroom. However, the Mishnah Berurah (21:14; 610:18) and Arukh Ha-Shulchan (21:6) rule like the original Taz.
Some people wear a hat and jacket whenever they go outside. For them, their hat and jacket are not designated specifically for prayer. Therefore, they may presumably wear them into a bathroom. Other people wear a hat and jacket only for prayer. I don’t wear mine back and forth everyday but leave it in my office for mincha and have a separate set at home. People like me, who generally wear a hat and jacket only for prayer, presumably should not take it into a bathroom.
III. Bathrooms Today
A separate issue is whether modern plumbing has rendered our bathrooms so different from those of ancient times that they enter a new halakhic classification. R. Ari Zivotofsky plumbed the depths of this subject in an article titled “Halacha and Modern Plumbing” (Journal of Halacha and Contemporary Society XXIX, Spring 1995). He shows how authorities differ over what status bathrooms to day have, some being very lenient, others strict and some recommending avoiding leniency when possible. He concludes on this subject: “However, if one can be stringent, it seems it would be consistent with the dignity due these articles of clothing that are designated for prayer not to wear them in a bathroom” (pp. 126-127).
My general impression is that the common practice is to treat bathrooms stringently and not to recite blessings or bring holy items inside one. Therefore, you should avoid bringing into a bathroom your hat and/or jacket that are designated for prayer. You should instead place them on a chair or other object outside the bathroom, or double back and pick them up before prayer. If all that is impossible, there is probably some room for leniency.
By wearing specific garments for prayer you are elevating them into tools for religious worship. It is your task to treat your tools with the care and respect they deserve.
(On all this, of course, ask your rabbi and do not rely on internet musings.)