In a medium saucepan, add the raspberries, granulated sugar, lemon juice, and lemon zest. Set the saucepan over medium heat and stir with a silicone spatula to combine. Cook until the mixture begins to boil, mashing down the raspberries as they soften.
Once the mixture starts to boil, lower the heat and simmer for 10-15 minutes while you continue stirring occasionally. Then, remove from heat and use a fine mesh sieve to strain out the seeds over a medium bowl. Use the silicone spatula to press the raspberry mixture into the sieve, scraping the other side of the sieve often to capture the strained raspberry mixture. After straining, you’ll be left with about 1/4 Cup of seedy pulp.
In a small separate bowl, combine the cornstarch and water until uniform. Return the strained raspberry filling to the saucepan (wipe it free of any remaining seeds if needed) and add the cornstarch/water mixture. Set the saucepan over medium heat and bring the mixture back to a boil, stirring constantly. Once it's boiling, reduce the heat to a simmer and let it cook for 1-3 minutes, until the filling has thickened slightly, is no longer cloudy, and coats the back of the spatula.
Pour the raspberry filling into an airtight container and refrigerate for at least 4 hours and up to 1 week. The longer you refrigerate, the thicker and more flavorful it will be. It will be jello-like once set but after stirring it will become a thick, jammy consistency.
When the raspberry filling has cooled and thickened, you're ready to use it as a cake or cupcake filling! If you're using it to fill a cake, be sure to pipe a buttercream dam around the edge of your cake layer before filling in the center with this raspberry filling. This way it won't squish out from between your cake layers. This blog post has more details on the filling process.