Mechanism of dimedone preparation
You will need to start in basic conditions. Dimethyl malonate is a good nucleophile on account of the two ester groups on either side of the central carbon atom. It has a $\mathrm{p}K_\mathrm{a}$ of 12.9, which is extremely acidic for a $\ce{C-H}$ bond. The first step is a Michael addition.



The resultant enolate will equilibrate, enabling it to form a much more stable 6 membered ring. We then have a Claisen condensation.





Lastly, decarboxylation will yield dimedone.