Display on Arduino r4 wifi shows only a white screen

I want to use a 4inch TFT display on the Arduino r4 WiFi. It showed nothing the first time. After a little bit of digging on the Arduino forums I came across a person with the exact same problem as me here. I had to use the MCUFRIEND library and add some stuff to utility/mcufriend_shield in the MCUFREIND library. Now it shows a white screen

My display

#include <MCUFRIEND_kbv.h> // Hardware-specific library for MCUFRIEND shields

MCUFRIEND_kbv tft; // Create an instance of the display

// Define color constants
#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

void setup() {
    uint16_t ID = tft.readID(); // Identify the display
    tft.begin(ID); // Initialize the display
    tft.setRotation(1); // Set the rotation (0-3)
    tft.fillScreen(BLACK); // Clear the screen with black color
    tft.setTextColor(WHITE); // Set text color to white
    tft.setTextSize(2); // Set text size to 2
    tft.setCursor(50, 50); // Set the cursor at x=50, y=50
    tft.print("Hello, ILI9486!"); // Print a message on the display
}

void loop() {
    // Empty loop
}

Is it means that the display worked at start, and after you changed the code - now it shows only a white?
If so - could you return to initial code to test if the TFT works?

No, I said it didn't work at all at first.

Waveshare has specific libraries and drivers that you have to use. If you're using the model that I am using, here