The scope of you variable guess_word was limited to within the while loop, hence outside of it in the if it is now known.
Your code fixed is below:
using System;
using System.IO;
class Program
{
static void Main(string[] args)
{
int guess_count = 0;
int guess_max = 3;
string word = "kostadin";
string guess_word;
while (guess_count != guess_max)
{
Console.Write("Enter your guess: ");
guess_word = Console.ReadLine();
if (guess_word == word)
{
Console.WriteLine("You win!");
break;
}
guess_count++;
}
if (guess_word != word)
{
Console.WriteLine("You lose!");
}
}
}