Synthesis and applications of functionalized magnetic materials in sample preparation