How can I print a variable in the node template?
If it's a variable that came from a hook_preprocess_node, you can just print it in your twig template as you wrote it in your example:

{{ variable_name }}