People do what they need to survive, but the only reason people HAVE to survive of of child labour is because consumers pay for the cheap goods, if we wouldn't buy those cheap goods, the industry over there wouldn't be able to work with child labour because they wouldn't sell anything anymore, they would be forced to use adults for production and labour, giving the children time to do whatever kids do in those countries, hopefully going to school.
This is how capitalism is intended to work from a humanist standpoint, sadly capitalists are rarely humanist.
Sex work and child labour only happens because there is a market for it, like with any other service or good that is produced and distributed, no consuming? No producing. It is the consuments duty to not be a brainless shoppingzombie looking for the cheapest prices. Its the consuments responsibility to buy durable products from durable industries.
TLDR: Don't buy sex and or child labour. If you do, you are partially responsible for their being sex/child labour in the world.