Import

You can import local and external files in Solidity.

Local

Here is our folder structure.

├── Import.sol
└── Foo.sol

Foo.sol

pragma solidity ^0.5.11;

contract Foo {
    string public name = "Foo";
}

Import.sol

pragma solidity ^0.5.11;

// import Foo.sol from current directory
import "./Foo.sol";

contract Import {
    // Initialize Foo.sol
    Foo public foo = new Foo();

    // Test Foo.sol by getting it's name.
    function getFooName() public view returns (string memory) {
        return foo.name();
    }
}

External

You can also import from GitHub, but you need to drop blob/<branch name> from the URL.

// https://github.com/owner/repo/blob/master/path/to/Contract.sol

import "github.com/owner/repo/path/to/Contract.sol"

Try on Remix