How do I carry the background thread when knitting letters with different color?
You don’t carry the yarns. Each letter, or section of letter, would have it’s own piece of yarn, with a strand in each section of the main color, as well.
The technique you need is called Intarsia. There are videos here, and several tutorials around–just Google.
If the letters go all the way across or around something and there are not super long runs where you don’t use one color, I have used stranded knitting. That means I carried the color not in use. You can even carry them quite a ways if you want to. This works best if the yarns are not super contrasting like black and white, because where you catch them in can show a bit. If you want to carry the colors stagger the places where they are caught in, and keep the floats loose or things will pucker. I used stranded knitting for my Moose Chullo (in my Rarvelry projects). It has some long carries, but I chose to do it because it was in the round. Even with careful stretching to keep the floats loose it looked a bit rough until it was blocked. Because it was wool it blocked up very well, if you are using acrylic that won’t work as well.
See the video on stranded (may be called Faire Isle) work. But consider the intarsia too, it may be best. You can also duplicate stitch letters on or sometimes I use a combination of either intarsia or stranded and duplicate stitch for small areas.
Here is a link to some explanation about Faire Isle work including how to catch in the floats. This says to catch them in every 2 stitches. I never do that, but if the float needs to be carried more than 5 stitches or with fine yarn (and in certain cases) what amounts to an inches worth of stitches I catch them in. LINK
It depends on what you’re making. Depending on what the project is and how the color fits in you may need to use intarsia or stranded. You can also add it after the fact with duplicate stitch.
For example…if it’s just big letter on the front you’d use intarsia, if the letters go all the way around you might be able to use stranded (fair isle).