Answer:
By hiring thugs and crooked cops
Step-by-step explanation:
Boss Willliam Tweed was a politician form the Democratic Party. Generally, he run on anti-immigration platform. So, he's not really popular among immigrant voters.
To take care of this, he hired thugs and cops to actively harass those immigrants.
They're ordered to do various criminal activities (such as destroying stores owned by immigrants, stopping them on secluded roads to give the immigrants a beating, etc). They did this to make sure that immigrants are afraid of leaving their home and casted their vote against William Tweed.