How to add CSS to head by php through echo self::css();

This tutorial seems to create a whole class for working with css.

How about starting with a very basic example and working from there.

In order to add <style> to <head> you could hook into wp_head action.
Most theme uses it to load all styles, scripts etc., so you can be sure that you can hook into it.

A very basic example would look like this

add_action('wp_head', 'bt_custom_head_style');
function bt_custom_head_style () {
?>
<style>
    body {
        background-color: hsl(200, 50%, 50%);
    }
</style>
<?php
}

This code goes into your function.php.