In targeted drug delivery, the nanoparticles are loaded with therapeutic agents and injected into the bloodstream. An external magnetic field is then applied to concentrate the particles at the desired location, such as a tumor site. The magnetic field can be adjusted in intensity and direction to optimize the concentration and retention of the nanoparticles, ensuring that the drug is delivered precisely where it's needed.