get data from Canvas

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

public class PauseBtnScript : MonoBehaviour
{

public Canvas pauseMenu;//this is 'Canvas' need to get "sortingOrder" drag this to "pauseMenu" in "unity"
public int pauseMenuLayer;// this is the variable "int" records "sortingOrder" of "pauseMenu"

void Start()
{
    // Canvas
    pauseMenuLayer = GetComponent<Canvas>().pauseMenu.sortingOrder;     

//‘Canvas’ does not contain a definition for ‘pauseMenu’ and no accessible extension method ‘pauseMenu’ accepting a first argument of type ‘Canvas’ could be found (are you missing a using directive or an assembly

}

Make sure that you assign the Canvas to public variable.
And it also have canvas component. Better include screenshot.