Taking two threads – or two ends of the same thread –- and tying them together in a knot is the melacha of kosheir. The Talmud in tractate Shabbos (74b) discusses the uses of tying in building the Mishkan. One use was to make the nets that were necessary to catch the chilazon, a shellfish whose dye was necessary for certain coverings.
It is forbidden on Shabbos to make a knot that is either of a type that is typically intended to be long-lasting or a knot of a particularly expert type. An example of an expert knot is a sailor’s knot, which is meant to tie up a boat indefinitely so that it doesn’t float away. Knots of a decidedly temporary nature – such as neckties – may be tied on Shabbos. (Actually, there are those who are stringent in this matter, especially if the tie is not undone when it is taken off. It might to advisable to remove one’s tie by untying it rather than slipping it over one’s head and tossing it aside.)
Shoelaces may be tied normally on Shabbos with a regular bow. A tight double knot, however, is prohibited. And, of course, if your shoelace should break on Shabbos, you would not be permitted to tie the two ends together.
Issues of kosheir can come up many times on Shabbos, from trash bags to bathrobes, and from hair ribbons to twist ties. (I am by no means suggesting that all of these things are inherently forbidden activities on Shabbos, just that there are many areas in which questions of tying can arise.) It certainly behooves us to familiarize ourselves with the intricacies of this melacha.
This is just an introduction to the concepts of the melacha of kosheir; it is not a substitute for a full study of the halachos.