My 20x2 LCD doesnt work properly

I already tried to run the code with that in it, but it didnt work either. The only change it made was that the characters where a bit more vague, and thats it. It wasnt an improvement, so I left it out, or should I put it back in?

You will not be able to use the second line without it. The characters were vague since the same contrast voltage will produce different results when the display is set up for two lines vs one line.

Now, getting back to your original problem....
It looks like you are using the Arduino to control the contrast. Using a value of 0 is the same as connicting pin 3 to GND when you typically want a small positive voltage on that pin. Also there is a conflict between the pin you appear to be using for the contrast [int contrastpin = 2;] and the pin you are using for LCD data line D7 [LiquidCrystal lcd(12, 10, 5, 4, 3, 2);].

Also, you want to leave loop() empty. You should move lcd.setCursor(0, 1); to the end of setup() and use another lcd.print() to put some different information on the second line.

If it still does not work then a clear (focused) photograph showing the connections between your LCD and your Arduino will be needed.

Don