Global losses of biodiversity have galvanised efforts to understand how changes to communities affect ecological processes, including transmission of infectious pathogens. Here, we review recent research on diversity-disease relationships and identify future priorities. Growing evidence from experimental, observational and modelling studies indicates that biodiversity changes alter infection for a range of pathogens and through diverse mechanisms. Drawing upon lessons from the community ecology of free-living organisms, we illustrate how recent advances from biodiversity research generally can provide necessary theoretical foundations, inform experimental designs, and guide future research at the interface between infectious disease risk and changing ecological communities. Dilution effects are expected when ecological communities are nested and interactions between the pathogen and the most competent host group(s) persist or increase as biodiversity declines. To move beyond polarising debates about the generality of diversity effects and develop a predictive framework, we emphasise the need to identify how the effects of diversity vary with temporal and spatial scale, to explore how realistic patterns of community assembly affect transmission, and to use experimental studies to consider mechanisms beyond simple changes in host richness, including shifts in trophic structure, functional diversity and symbiont composition.