\textbackslash is just for typesetting. As the name says, it's a text command, so it just prints the character \ from the current font, and isn't of any use for anything other than that.
You are looking for:
\catcode`\\=12
The syntax for the \catcode primitive is \catcode<number>=<catcode>, and it sets the catcode of the character whose ASCII code is <number> to <catcode>. This means that you could also use:
\catcode 92=12
However it's a mouthful to remember all the ASCII codes, and your code becomes quite a lot less readable. To improve on that TeX allows you to specify a number using an “alphabetic constant”. To do that, the <number> should start with a `, followed by the character token you want to make a number of. Valid alphabetic constants are `a, `*, etc.
The only problem is that a catcode-0 character (here the backslash) doesn't produce a token, so neither:
\catcode`\=12
\catcode`\ =12
do what you want (the first one changes the catcode of =, and the second the catcode of ). To specify these characters, TeX allows you to escape the character with a backslash, so to specify the alphabeitc constant `\ you prefix it with another backslash: `\\, so:
\catcode`\\=12
allows you to change\` from newline to a backslash? I didn't know that! +1 and accept – Someone May 11 '20 at 15:42\textbackslashwas used for typesetting. However, it was the best I could come up with. – Someone May 11 '20 at 15:43\``, the next token can be either a character, or a character preceded by a backslash. In the case of ``\\`` you _need_ the preceding backslash because a single backslash doesn't make a token. Note that this works: ``\catcode|=0 \catcode\\=12 |catcode=3 |show`` because after the second\catcode, the backslash is just a character, so you don't have to prefix a backslash anymore. – Phelype Oleinik May 11 '20 at 16:4192(the ASCII code of\) when TeX is looking for a number. Everywhere else it will mean open quote and\\. Compare the output of(\number`\\)(`\\). – Phelype Oleinik May 12 '20 at 18:30`method work for characters that are not ASCII? – youthdoo Nov 08 '22 at 14:50