Using Visual Studio you can give your Custom Sharepoint Page Anonymous Access .

Edit Your Code By Changing the  **public partial class** as below -

    using System;    
    using System.Web.UI;    
    using Microsoft.SharePoint;    
    
    namespace Custom.Layouts.Custom    
    {       
     public partial class MyPage : UnsecuredLayoutsPageBase       
     {           
          protected override bool AllowAnonymousAccess            
          {               
                get               
                {    
                    return true;
                }
            }    
            protected void Page_Load(object sender, EventArgs e)
            {

               //Ur code goes here

            }    
        }
    }

    
Also if you want to remove default Sharepoint Footer & Header ,kindly Remove **DynamicMasterPageFile="masterurl/default.master"** as below screenshot -

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/yHYwF.png