For eg : لَمْ يَكْتُبْ and مَا کَتَبَ both means "he did not write." So how would I know which one i should use?
In Classical Arabic there does not seem to be any difference in usage between maa + perfect and lam + jussive. In modern Arabic dialects only the former has survived. For this reason modern authors tend to avoid the form with maa in the mistaken belief that this is non-classical, or at least to treat the form with lam as belonging to the more formal register.