you need to extend your Cargo Scoop (Home key on your number pad by default I think).
Then you will see a little display on the left hand side that shows your relative position to the cargo, fly slowly and carefully so that it fills the blue box and voila! Cargo Scooped!
Be aware - Black boxes and other 'recovery' missions tag the item as 'stolen', so if you get scanned by local security forces while you enter the star port, you will be heavily fined. you need to be able to either go in to the station 'cold' (to make it harder for Law Enforcement to scan you) or fast (ditto).
Good Luck Commander! fly Safe o7