Adding the contextual link render element
First of, usually you want to handle the contextual links in your preprocess theme function so you don't have to handle it every time you need to render the thing.

The actual contual links is added to title_suffix, so you need to do {{ title_suffix }} somewhere in your template to actual render the contextual links. You also need to render the attributes or make sure your wrapper html tag has the contextual-region class.

In Drupal 8, most of contexual links are used with relationship to an entity. If you have something you can view and edit most likely it should be an entity, meaning you should use the entity view builder to render it etc. Might also make it easier for you to do contextual links, as there are many examples of how this is done in core and contrib, like the node module, user module taxonomy module etc.