Use functionality in third-party plugin in my own plugin

This really depends on the scoping of the code you want to use and whether there are actions or filters that encompass the functionality.

You should be able to check whether the code you want is available with a combination of class_exists() and function_exists() calls. But this will depend on whether the classes and functions you want to use are scoped as public, protected or private.

If you can determine that the plugin is loaded and are lucky enough that the code you want to utilise is wrapped up in an action or filter then you should be able to simply do_action or apply_filters based on the assumption that the other plugin will handle it for you. But this is an unlikely scenario I expect.

If the plugin and its classes you want don’t exist, what are you going to do instead though, just not enable that feature?