Semialgebraic graphs are a convenient way to encode many problems in discrete geometry. These include the Erdős unit distance problem and many of its variants, the point-line incidence problems studied by Szemerédi–Trotter and by Guth–Katz, more general problems about incidences of varieties, and many more examples.I will discuss a number of new structural and extremal results about semialgebraic graphs and hypergraphs and the geometric consequences of these results. These include a regularity lemma with asymptotically optimal bounds, as well as results on the Turán problem and the Zarankiewicz problem for semialgebraic hypergraphs. These results are proved via a novel extension of the polynomial method, building upon the real polynomial partitioning machinery of Guth–Katz and Walsh. Based on joint work with Hung-Hsun Hans Yu.