Your child may have been diagnosed with a congenital heart defect. This is a problem with the structure or function of the heart that is present at birth. Congenital heart defects can be diagnosed before birth, during infancy or later in life.