"Magic strings" are hardcoded strings in the programs. Though its extremely convenient to just embed the required strings in the program, it is a bad practice to do so.
The recommended approach is to use named constants. If needed extract them into resource files.
In Rider, its easy to extract variable or inline variable with just context help as shown in this short video.