Start here. This is the direct spoken answer to practice first.
Why this question matters
Many memory issues come from ordinary code that materializes data too early or too often. This is especially common in APIs that map database rows into response models.
Intermediate lists waste memory when the code materializes data that could be filtered, projected, or streamed without storing every step. ToList is useful when I need a stable snapshot, but repeated ToList calls can duplicate data and increase allocation. If I know the final count, setting list capacity can also reduce resizing. I would simplify the pipeline so only necessary data is materialized.