One tool to help prevent that in Washington, D.C. is called the Tenant Opportunity to Purchase Act.
The truth about displacement
Does Inclusionary Zoning Work?
However, inclusionary zoning can produce mixed results and there isn't general agreement that it actually helps affordable housing in the city as a whole,
Not fixing housing in CA
Parking or Affordability?
Parking is one of those costs, and requirements to build parking increases the costs of homes.
Excluded from Involvement
Make small cities awesome to make big cities affordable
City Planning and Suburban Planning
Many of our zoning codes are ideal for creating car dependent suburbs, but they don't work well to encourage mixed use cities.
Strip malls and government regulations
If we know that we want mixed use buildings that encourage walkability, why do we keep ending up with strip malls?
Buying while young- the challenges
What happens when a young person considering buying a home in one of the many cities across our country that have had skyrocketing home prices?