In a food processor or blender, combine fresh basil leaves, grated Parmesan cheese, pine nuts (or walnuts), and minced garlic.
Pulse the ingredients a few times until they are coarsely chopped and well combined.
While the food processor is running, gradually pour the olive oil into the mixture in a steady stream until the sauce reaches a smooth and creamy consistency.
Stop the food processor and scrape down the sides with a spatula, ensuring all the ingredients are well incorporated.
Taste the pesto sauce and season with salt and pepper according to your preference. Pulse again briefly to combine.
Transfer the pesto sauce to a jar or airtight container for storage.