I am a content writer. I write content for different niches like health, fashion, entertainment, and more. But if someone orders me to write content/articles for casino and gambling niche and I write them. is it haram or halal?
The direct answer would be that it is forbidden.
However you need to consider your specific situation. Is it a major part of your work. You should start looking of alternatives. If it is a minor part, you might just finish it and move on.
Sometimes there are lateral solutions. I know a muslim friend who is a service engineer for some industrial equipments. He was assigned to service equipment in an alcohol factory. (The equipment was not specifically designed for alcohol factory). He asked his boss informally. His boss assigned him to different site and sent someone else in his place.
Bismillah In Surah Al-Maidah Verse 2: ۘ وَتَعَاوَنُوا۟ عَلَى ٱلْبِرِّ وَٱلتَّقْوَىٰ ۖ وَلَا تَعَاوَنُوا۟ عَلَى ٱلْإِثْمِ وَٱلْعُدْوَٰنِ ۚ وَٱتَّقُوا۟ ٱللَّهَ ۖ إِنَّ ٱللَّهَ شَدِيدُ ٱلْعِقَابِ ٢
Cooperate with one another in goodness and righteousness, and do not cooperate in sin and transgression. And be mindful of Allah. Surely Allah is severe in punishment.
If you can avoid it, better not to do it. While the halal is still available.