The three biggest problems were rain, disease, and transportation.
The rain, particularly during the wet season, would cause mud slides and make the ground very dangerous. Weeks of work were often wasted every time a mud slide filled in areas previously dug out. This was most evident in the Culebra Cut. The cut was an artificial valley, not too far from Panama City, that had to be dug two feet wide for every foot deep. It was considered one of the biggest engineering feats of the time. The cut was an early adopter of terracing for that reason.
Diseases such as malaria, yellow fever, cholera, and dengue fever were transmitted by mosquitos. While the French were building the canal, disease took a massive hit on the labor, killing thousands of able-bodied men. It was a long time before officials realized that standing water was attracting the mosquitoes. When the Americans took over the project, they made an enormous effort to remove all bodies of water from the cities. Hospital bed posts were submersed in water to prevent termites. People kept barrels for water outside their homes. All of that water had to be covered or removed. They were able to get the diseases under control, but it’d be a long time before cures and pesticide efforts were put in place. Panama still employs trucks that spray for mosquitoes regularly.
The third problem was the transportation of men, supplies, and the soil as it was being removed. The construction of a railway greatly helped by hauling millions of tons of men, equipment, and supplies, but more importantly hauled the hundreds of millions of cubic yards of material removed from the canal cuts.
I highly recommend reading the book The Path between the Seas: The Creation of the Panama Canal, by David McCullough. It is loaded with highly detailed information from the very beginning of the canal construction through the completion of the project 44 years later,
Hope this helps!