How to Display my HTML form in my Custom Plugin?

Here is the process I follow.

Step 1. specify the slug of the page you are putting the page on. To avoid hard coding this into the plugin, I add a setting option to store the slug of the page. So if I change the page, I only have to specify the slug of the new page in the settings page.

function my_plugin_settings_page() {
//Add a settings page for this plugin to the Settings menu.
add_options_page( 'My Plugin Settings', 'My Settings', 'manage_options', 'my-plugin-settings', 'display_my_plugin_settings' );
}


function display_my_plugin_settings{?>
<div class="wrap">

<h2><?php echo esc_html(get_admin_page_title()); ?></h2>
<?php 
$options = get_option('my-plugin');
settings_fields('my-plugin');
?>
    <form method="post" name="my-plugin-settings" action="options.php">
    <fieldset>
        <legend class="screen-reader-text"><span><?php _e('Signup Page', 'my-plugin'); ?></span></legend>
        <label for="my-plugin-signup">
            <?php echo home_url("https://wordpress.stackexchange.com/");?><input type="text" id="my-plugin-agent_signup" name="my-plugin[signup]" value="<?php echo $options['signup'];?>"/>
            <span><?php esc_attr_e('Signup Page', 'my-plugin'); ?></span><br>
            <span class="description"><?php esc_attr_e('The signup form will be added to the end of this page', 'my-plugin'); ?></span>
        </label>
    </fieldset>

<?php submit_button('Save', 'primary','submit', TRUE); ?>
</form>
</div>
<?php}

add_action( 'admin_menu', 'my_plugin_settings_page' );

Step 2. You have to change the template to be used on that page. For that we use the hook page_template.

public function signup_template($page_template) {
        $options = get_option('my-plugin'); //get plugin options
         if (is_page( $options['signup'] )) {
              $page_template = dirname( __FILE__ ) . '/public/partials/registrationform.php'; 
              //change the template if the page is the one specified
         }
         return $page_template;
    } 

add_filter( 'page_template', 'user_profile_template', 11 ); //filter hook to change the page template