Trujillo rose up through the army ranks, with many officers above him "disappearing." He supported a planned coup in 1930 by refusing to use his troops to stop it as ordered by the government. He then became president.
Like so many strongmen before and since, Trujillo used a well-worn playbook to consolidate and maintain power. First, he used the military to brutally repress any dissent. People who opposed him often "disappeared," only to be found dead later. He was not afraid to terrorize the population with massacres and allowed a rival political party to form to flush out dissidents.
Trujillo also set up an extensive surveillance state. With everyone spied on, people were afraid to voice criticism of the regime for fear of violent reprisals. As is shown in the novel, the Mirabal sisters have to learn a whole new vocabulary to hide what they are doing when they join the resistance.
Trujillo, like Hitler and Stalin, established a cult of personality around the idea of his "greatness." People were expected to have portraits of him in their homes, and schools taught young children that he was a great and benevolent leader. Trujillo allied himself as well with the Roman Catholic Church, gaining its crucial support and legitimizing him as a leader. Statues of Trujillo were erected everywhere, and the capital city was renamed after him. This cult of personality acted oppressively as it then became easy to portray any attack on Trujillo's policies as an attack on the state itself— and on the will of God. As we see in the novel, women who might have raised dissenting voice were driven out of professions and into the home as Trujillo worked to masculinize power.
It is also important to follow the money: in Trujillo's case, he had the backing of the US government.