How would you design a heat shield for a spacecraft re-entering Earth's atmosphere?

To set the stage, spacecrafts can enter low-earth orbit, an altitude of ~1200 miles, at speeds of 17500 mph. Temperatures can reach up to 5000F.

The issue arises with the increase in air density as altitude decreases, causing intense aerothermal heating which has the potential to destroy the spacecraft structure or hurts its occupants such as astronauts.

The use of a heat shield’s geometry can provide drag to slow down the spacecraft and also thermal protection through its material selection.

Geometry can influence the stability (along with center of mass) and drag of the spacecraft and may be predefined due to the nature of operation such as the space shuttle for example. Other capsules can take the form of more symmetrical shapes below.

In terms of materials used, some material is designed to be burnt off and is called ablative material. Examples of these materials are forms of resins, epoxies, and carbon. The other type of material used is refractory material which isn’t intended to be sacrificial and has high melting points and low conductivities. An example of this material is silica tiles as shown below.

To answer the question, we can use the dragon capsule as example:

For starters, knowing the requirements is key. This capsule can carry 7 passengers with a return payload mass of 3000kg and is reusable. Knowing the size of its cargo can indicate rough dimensions, in this case a capsule volume of 9.3 m3, and add some dimension to the overall geometry.

The overall geometry follows previous designs in that its conned shape with a flat-ish base. This shape has the added benefit of increasing the distance between the material surface and shockwave created which further reduces heating.

The type of insulation is ablative and the material used is called Phenolic-Impregnated Carbon Ablator (PICA-X) with the shield being replaced so the capsule can be reused. PICA was initally developed by NASA and is lighter than its counterparts which means useful payload (and money made) can be increased.

Good resources to learn more:
NASA Ames Helps SpaceX Develop Dragon’s Heat Shield
HOW SPACESHIP HEAT SHIELDS WORK
How does the Crew Dragon Spacecraft work? (SpaceX)