Given a positive integer r and a graph G with degree sequence d1,…,dn, we define er(G)=∑i=1ndir. We let exr(n,F) be the largest value of er(G) if G is an n-vertex F-free graph. We show that if F has a color-critical edge, then exr(n,F)=er(G) for a complete (χ(F)−1)-partite graph G (this was known for cliques and C5). We obtain exact results for several other non-bipartite graphs and also determine exr(n,C4) for r≥3. We also give simple proofs of multiple known results. Our key observation is the connection to ex(n,Sr,F), which is the largest number of copies of Sr in n-vertex F-free graphs, where Sr is the star with r leaves. We explore this connection and apply methods from the study of ex(n,Sr,F) to prove our results. We also obtain several new results on ex(n,Sr,F).