Seriously, get a book! You don't need to use courses - although they are a real help - but anything with a structure to it is going to be a lot better than trying to code random tasks and getting nowhere. Wrox and Addison Wesley both do some very good ones on C#, which will take you through from beginner to coder (though you will need experience on top of that).
Dictionary<string, string> userData = new Dictionary<string, string>();
userData["joseph"] = "password1";
userData["william"] = "password2";
string userinputName = "joseph";
string userInputPassword = "password1";
if (userData.ContainsKey(userinputName))
{
if (userData[userinputName] == userInputPassword)
{
Console.WriteLine("OK");
}
else
{
Console.WriteLine("Failed to match");
}
}
else
{
Console.WriteLine("Unknown user");
}
It's not quite what I would do - I'd probably create a User class which contained the name and (hashed) password - but it should do what you want!