It's not totally clear what your problem is, but does this help?
while (true)
{
Console.Write("What's the magic word? ");
string word = Console.ReadLine();
if (word == "shazam")
{
Console.WriteLine("You guessed it!");
break;
}
else
{
Console.WriteLine("Sorry, try again!");
}
}