to build, have the mats in a ship or facility avaliable in the city you are in, stand to the left or above wher you want the facility to be, with the npc builders in your party. Then scrolly down to the right side of the screen where it says [Facility Construction] clicky and follw the directions. You need builders, mats, and money. If it's a special kind of facility like a mine, or a library you need I believe it's manage facilities lvl 3 from the faction that can build those.
You also need to have building permissions in the city you are in. If you own the city, or it's a faction city and you have building privileges, you'll be able to build in it by default, and otherwise you'll receive an option to request build permissions if you try to build something and it fails due to your lack of permissions.