How to set in my own module dependency on a composer package?
You can add dependencies in your module.

Navigate to your module's root folder. Run composer init. When you get to the question Would you like to define your dependencies (require) interactively, say yes. You can then declare any composer libraries your module depends on.

You can also manually create a composer.json file that looks something like this:

{
    "name": "uniquenamespace/packagename",
    "description": "This module does some stuff",
    "type": "drupal-module",
    "authors": [
        {
            "name": "Some Guy",
            "homepage": "https://www.example.com/some_guy",
            "role": "Maintainer"
        }
    ],
    "require": {
        "somevendor/somepackage": "^1.9"
    },
    "license": "GPL-2.0-or-later"
}


Run composer validate to check that your composer.json file is valid.