Raspberry Pi 3 disable unused ports RancherOS

Is there any tutorial or any explanation on how I can disable unused ports on a rasperry Pi 3 in which I installed RancherOS? I would like to disable all USB ports, wifi, display port, and lower the GPU Memory consumption. I would be really grateful if someone could lend me a hand for figuring this out.