getting 404 error while developing an example module I have created custom module named hello 
my files are 

hello.info.yml  is

name: Hello 
type: module 
description: 'My first Drupal 8 module.' 
package: Awesome modules 
version: 1.0 
core: '8.x' 


hello.module file is 

&lt;?php 

use Drupal\Core\Routing\RouteMatchInterface; 
function hello_hello_world() {    

    return t('Hello Drupal 8 World!'); 

}


** hello.routing.yml** file is 

hello.content:   
  path: '/hello'   
    defaults:     
       _controller: '\Drupal\hello\Controller\HelloController::sayhello'   
  requirements:     
    _permission: 'access content'


and last one is HelloController.php is under hello/src/Controller folder

&lt;?php

namespace Drupal\hello\Controller;
use Drupal\Core\Controller\ControllerBase;

/**
 *
 */
class HelloController extends ControllerBase {
    /**
     * [sayhello description]
     * @return [type] [description]
     */
    public function sayhello() {
        return array('#markup' =&gt; hello_hello_world());
    }
}


when we browse this page mywebsite.com/hello it gives a 404 error page.

Note: module is successfully enabled from admin
The indentation of your hello.routing.yml file is wrong. It should be as the following one. (See user.routing.yml.)

user.pass:
  path: '/user/password'
  defaults:
    _form: '\Drupal\user\Form\UserPasswordForm'
    _title: 'Reset your password'
  requirements:
    _access: 'TRUE'
  options:
    _maintenance_access: TRUE


Indentation in YAML files is very important, since it changes the file content.

Notice that you can use _access: 'TRUE', when the page doesn't require a specific permission. The _maintenance_access: TRUE line is not necessary. If you use it, users have access to your route even when the site is in maintenance mode; other requirements are still respected, so you could have something similar to the following.

user.login:
  path: '/user/login'
  defaults:
    _form: '\Drupal\user\Form\UserLoginForm'
    _title: 'Log in'
  requirements:
    _user_is_logged_in: 'FALSE'
  options:
    _maintenance_access: TRUE


Before making any changes, uninstall the module, fix the file, and re-install the module.

As side note, you don't need the use Drupal\Core\Routing\RouteMatchInterface; line in your hello.module file, since you aren't using that PHP interface.