To fly somewhere and load the ship you came on with mats, you need the following:
A facility holding the mats.
For the process to work, you must be assigned as pilot to the vessel and operator to the facility. Land outside the designated storage facility, exit your vessel, and enter the facility.
Then, like Mikel said, "You have to go into the starport [or whatever facility], find the building management room (cockpit), then load them [the mats] onto your ship through the 'materials' interface."
Like the ship you came on, you have to be assigned as operator (pilot) of the facility for the above-quoted action to work. Then you re-board your vessel, double-check the mats are aboard, and fly away.