user76428: 
#include "Keypad.h"

char Incoming_value = 0;
String password = "123456";
String input = "";
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {2, 3, 4, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8,9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop()
{
  if (Serial.available() > 0)
  {
    Incoming_value = Serial.read();
    Serial.print(Incoming_value);
    Serial.print("enter value");
    if (Incoming_value == '1') {
      digitalWrite(13, HIGH);
      Serial.print("ON");
    }
    else if (Incoming_value == '0') {
      Serial.print("OFF");
      digitalWrite(13, LOW);
    }
  }
  // Read the pushed button
  char key = keypad.getKey();
  input = input + key;
  // just print the pressed key
  if (key) {
    Serial.println(key);
  }
  if(key == '*' ){
    Serial.println(input);
    if( input == password){
      digitalWrite(13, HIGH);
    }
  }
  if(key == '#'){
    digitalWrite(13, LOW);
    input = "";
  }
  
/*
  // this checkes if 4 is pressed, then do something. Here  we print the text but you can control something.
  if (key == '4') {
    Serial.println("Key 4 is pressed");
          digitalWrite(13, HIGH);
      Serial.print("ON");
  }
    if (key == '5') {
    Serial.println("Key 5 is pressed");
          digitalWrite(13, LOW);
      Serial.print("ON");
  }
  */
}

when print input variable i get strange text like

⸮⸮⸮⸮⸮⸮⸮;⸮⸮ߵ⸮⸮⸮⸮u⸮⸮⸮⸮⸮⸮?/}⸮⸮⸮⸮⸮⸮~⸮⸮⸮⸮⸮-d

what i can do ?

user67696: PS: @lurker's suggestion in the comments - check the baud rate setting in your serial monitor as well.
EDIT: I admit that the code in the previous version of this answer was foolishly typed out by me due to lack of patience, so I'll make up for my mistake(not in code, but as a full answer).
First of all, I didn't understand what you wanted to do with the Incoming_value variable in your sketch, so I'm not gonna talk about it; I'd suggest adding a sufficiently small delay at the end of the code in the loop. This should provide the serial port some time to handle the incoming data and stop printing the confusing output (perhaps; just because delays make your microcontroller wait for a while to get things done elsewhere , especially where the reception of data is slow and thus avoid collisions)
Also note that I am not a CS student or an electronics geek, but I am speaking from my guesswork. Any correction is accepted.

user42015: First of all you have to make sure, that you select the same baudrate in the Serial Monitor, that you used in your sketch with Serial.begin(). This error is very common and garbage values is the symptom of this.
But your code also has problems. You have the input variable of type String, which should hold the user input for comparison with the password. Directly after getting the key, you are appending this key to the string. You are assuming here, that keypad.getKey() is waiting for the user to actually press a key and then return that. But this is not the case. keypad.getKey() will return NO_KEY, when the user currently isn't pressing a key. This is defined in the Keypad library as '\0' (the null character), which marks the end of a string. Your code runs very fast, so you are adding more and more null characters to your string. Your strings gets bigger and bigger, filling your RAM very fast.
How to solve this: You should only use the return value of keypad.getKey(), if a key was actually pressed. Put all the code after it in an if statement, checking for NO_KEY:
// Read the pushed button
char key = keypad.getKey();
if(key != NO_KEY){
    input = input + key;
    // just print the pressed key
    if (key) {
        Serial.println(key);
    }
    if(key == '*' ){
        Serial.println(input);
        if( input == password){
            digitalWrite(13, HIGH);
        }
    }
    if(key == '#'){
        digitalWrite(13, LOW);
        input = "";
    }
}


76428: <pre><code>
#include &quot;Keypad.h&quot;

char Incoming_value = 0;
String password = &quot;123456&quot;;
String input = &quot;&quot;;
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};

byte rowPins[ROWS] = {2, 3, 4, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8,9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop()
{
  if (Serial.available() &gt; 0)
  {
    Incoming_value = Serial.read();
    Serial.print(Incoming_value);
    Serial.print(&quot;enter value&quot;);
    if (Incoming_value == '1') {
      digitalWrite(13, HIGH);
      Serial.print(&quot;ON&quot;);
    }
    else if (Incoming_value == '0') {
      Serial.print(&quot;OFF&quot;);
      digitalWrite(13, LOW);
    }
  }
  // Read the pushed button
  char key = keypad.getKey();
  input = input + key;
  // just print the pressed key
  if (key) {
    Serial.println(key);
  }
  if(key == '*' ){
    Serial.println(input);
    if( input == password){
      digitalWrite(13, HIGH);
    }
  }
  if(key == '#'){
    digitalWrite(13, LOW);
    input = &quot;&quot;;
  }
  
/*
  // this checkes if 4 is pressed, then do something. Here  we print the text but you can control something.
  if (key == '4') {
    Serial.println(&quot;Key 4 is pressed&quot;);
          digitalWrite(13, HIGH);
      Serial.print(&quot;ON&quot;);
  }
    if (key == '5') {
    Serial.println(&quot;Key 5 is pressed&quot;);
          digitalWrite(13, LOW);
      Serial.print(&quot;ON&quot;);
  }
  */
}
</code></pre>
<p>when print input variable i get strange text like</p>
<blockquote>
<p>⸮⸮⸮⸮⸮⸮⸮;⸮⸮ߵ⸮⸮⸮⸮u⸮⸮⸮⸮⸮⸮?/}⸮⸮⸮⸮⸮⸮~⸮⸮⸮⸮⸮-d</p>
</blockquote>
<p>what i can do ?</p>
 67696: <p><strong>PS</strong>: @lurker's suggestion in the comments - check the baud rate setting in your serial monitor as well.</p>
<p><strong>EDIT</strong>: I admit that the code in the previous version of this answer was foolishly typed out by me due to lack of patience, so I'll make up for my mistake(not in code, but as a full answer).</p>
<p>First of all, I didn't understand what you wanted to do with the <code>Incoming_value</code> variable in your sketch, so I'm not gonna talk about it; I'd suggest adding a sufficiently small delay at the end of the code in the loop. This should provide the serial port some time to handle the incoming data and stop printing the confusing output (perhaps; just because delays make your microcontroller wait for a while to get things done elsewhere , especially where the reception of data is slow and thus avoid collisions)</p>
<p>Also note that I am not a CS student or an electronics geek, but I am speaking from my guesswork. Any correction is accepted.</p>
 42015: <p>First of all you have to make sure, that you select the same baudrate in the Serial Monitor, that you used in your sketch with <code>Serial.begin()</code>. This error is very common and garbage values is the symptom of this.</p>
<p>But your code also has problems. You have the <code>input</code> variable of type <code>String</code>, which should hold the user input for comparison with the password. Directly after getting the key, you are appending this key to the string. You are assuming here, that <code>keypad.getKey()</code> is waiting for the user to actually press a key and then return that. But this is not the case. <code>keypad.getKey()</code> will return <code>NO_KEY</code>, when the user currently isn't pressing a key. This is defined in the <code>Keypad</code> library as <code>'\0'</code> (the null character), which marks the end of a string. Your code runs very fast, so you are adding more and more null characters to your string. Your strings gets bigger and bigger, filling your RAM very fast.</p>
<p><strong>How to solve this:</strong> You should only use the return value of <code>keypad.getKey()</code>, if a key was actually pressed. Put all the code after it in an if statement, checking for <code>NO_KEY</code>:</p>
<pre><code>// Read the pushed button
char key = keypad.getKey();
if(key != NO_KEY){
    input = input + key;
    // just print the pressed key
    if (key) {
        Serial.println(key);
    }
    if(key == '*' ){
        Serial.println(input);
        if( input == password){
            digitalWrite(13, HIGH);
        }
    }
    if(key == '#'){
        digitalWrite(13, LOW);
        input = &quot;&quot;;
    }
}
</code></pre>
