What is the ruling of putting on a black thread on a baby who often cries?
The ruling of wearing a thread or rope on the hand or leg of a baby with the belief that it could benefit or prevent harm is prohibited. According to W.W Skeat, wearing black thread or rope that is made into a bracelet is the tradition of previous Malay people to protect the baby or child from bajang. 
In Arabic, amulets or charms such as this is named tamimah. Imam al-Khattabi defined tamimah stating: “Threads put on by previous Arab community for their children with the intention of preventing ‘ain disease according to their belief.” 
In a hadith narrated from ‘Isa bin Abd al-Rahman bin Abi Laila, he said: I went to visit Abu Ma’bad Al-Juhani and I found his body inflamed (turned reddish). Then, I said to him: Didn’t you wear some amulet? He proceeded to reply:
الْمَوْتُ أَقْرَبُ مِنْ ذَلِكَ قَالَ النَّبِيُّ صلى الله عليه وسلم مَنْ تَعَلَّقَ شَيْئًا وُكِلَ إِلَيْهِ
“Death is better from such action. The Prophet PBUH said: anyone hangs anything on himself he will be left to it.” 
Syeikh Mulla Ali Al-Qari when commenting on this hadith cited the words of Ibn Al-Athir in his book: “Whoever hangs something on himself with amulets, charms, tamimah, and others similar to them with the belief that all of them could benefit or prevent harm, then surely, he will be left to them. Which means he is left together with the matter that he made as a protector and is abandoned with it.” 
There is a narration from ‘Imran bin Husain radhiyallahu ‘anhu where the Prophet PBUH saw a man wearing a bracelet on his hands. The Prophet PBUH then said:
مَا هَذِهِ الْحَلْقَةُ ” . قَالَ هَذِهِ مِنَ الْوَاهِنَةِ . قَالَ ” انْزِعْهَا فَإِنَّهَا لاَ تَزِيدُكَ إِلاَّ وَهْنًا
“What is this bracelet?” He said: “It is for an illness.” He said: “Take it off, for it will only increase you in weakness.” 
Hence, it is clear from the above hadith that the Prophet PBUH instructed the wearing of a bracelet with the intention and belief that it could heal to be avoided for it is definitely non-beneficial nor could it prevent harm. Wallahua’lam.
 Malay Magic, p. 321. Bajang is a type of ghost with long nails who likes to disturb pregnant women or children. See https://prpm.dbp.gov.my/cari1?keyword=bajang