The magnetometer is actually a different device inside the MPU9250 package, and accessing it requires a couple of additional steps.
Since you did not describe what went wrong with your attempts, try the code at the end of this post: MPU - 9250 - Can't Figure Out How to Read Magnetometer Values - #4 by louis002
Otherwise, just use one of the standard Arduino MPU9250 libraries, like that from Rowberg.