Crush the graham crackers or chocolate cookies into fine crumbs using a food processor or by sealing them in a plastic bag and crushing with a rolling pin.
Mix together the crushed crumbs, granulated sugar, and melted butter until evenly combined; this will form the 'dirt' layer.
Press the crumb mixture evenly into the bottom of a 9x13 inch dish using the back of a spoon or a spatula, creating a solid base that resembles soil.
In a mixing bowl, beat the softened cream cheese with powdered sugar until smooth and creamy, with no lumps remaining.
Add the whipped heavy cream to the cream cheese mixture gradually, folding gently until fully incorporated and fluffy.
Spread the creamy mixture over the crumb layer in an even layer, smoothing the top with a spatula.
Dollop the prepared chocolate pudding over the cream layer and gently spread it into an even layer, creating a dark, rich 'mud' look.
Decorate the top with colorful gummy worms—arrange them wriggling across the surface for a playful, creepy effect.
Refrigerate the dirt cake for at least 2 hours, allowing the flavors to meld and the layers to set firm.
Serve cold, slice into squares or rectangles, and enjoy the fun, dirt-inspired treat with worms and all!