Engineers play a crucial role in designing earthquake-resistant buildings by incorporating structural features that can withstand the forces generated during an earthquake. They analyze the seismic activity in the region, assess potential risks, and then design the building structure, foundation, and materials to minimize damage during an earthquake. Additionally, engineers also ensure that proper building codes and regulations are followed to enhance the building's overall seismic performance and safety.