Smoke Testing term came from the Hardware Testing. Like in hardware testing, Tester Check whether or not it Catch fire and smoke. Same as in Software Smoke testing tester check that the main functionality of software is working fine. In Smoke testing Some test cases are created which covers all the critical functionality of program and tester check that these functionality are working fine.
In Sanity testing tester check that main functionality of software is working. Sanity testing is done when the regression testing is over, it make sure that main functionality of software is working fine after all the defects are fixed in regression. The sanity testing is time and cost affective testing.