Prevention of congenital syphilis primarily involves screening and treating pregnant women for syphilis. Prenatal care should include routine serological testing for syphilis and prompt treatment if the infection is detected. Early and adequate treatment of syphilis in pregnant women can significantly reduce the risk of transmission to the fetus.