Magnet

Can you have an example? I tried to do it but it doesnt work.