This method is only possible if you can unlock your phone and access the Settings menu.
Take out your microSD card to avoid accidental formatting. How to Hard Reset Samsung GT-C3312 (Step-by-Step) Method 1: Using the Master Reset Code (Recommended) gt c3312 hard reset