How to call bind function in wordpress actions or hooks

Here’s reference from Codex

To use the add_action hook when your plugin or theme is built up using
classes, add $this to your add_action call together with the function
name within that class, like so:

class MyPluginClass {

    public function __construct() {
         //add your actions to the constructor!
         add_action( 'save_post', array( $this, 'save_posts' ) );
    }

    public function save_posts() {
         //do stuff here...
    }
}