You can use Dean Stark apparatus. The amine and the carbonyl compound is refluxed with dry benzene (sometimes catalytic p-toluene sulphonic acid is also used for unreactive carbonyl compounds) The liberated water comes out as azeotropic mixture of water and benzene and deposited in side arm. It is taken out from time to time. When calculated amount of water comes out, the reaction is completed. The method is very good but only drawback is use of benzene, a toxic solvent. But can be used with proper care.
Alternatel way is to reflux (with stiring) a mixture of amine and the carbonyl compound in anhydrous dichloromethane in presence of enough dry MgSO4 (which has been freshly dehydrated by heating to remove the water of crystallization). I have used both processes many times. In another method, I heard of using molecular sieves as an alternative of MgSO4 though I have never used it.
thank you for all am not use the Mgso4 because my final product solid . and also i can not able to use Dean-stark apparatus in all reaction because some of them at room T. when i work under nitrogen is that remove the water form as by product or just prevent the moisture .