How to get a field value from fields you can find here.
But if you need get the field value from field type "Date" it will not so easy as you expected.
For example, if you try to get the value from "Date" field like this:
$node->get('field_date')->getString();
It will return date with format Y-m-d\TH:i:s:
2024-06-05T00:00:00
And the problem is the next — Drupal keeps the records in UTC timezone. And you have to keep it in mind.
And what is it mean and why?
Well, the reason is different timezone for the site and for a user. For most cases it is the same timezone for the site and for a user. But, we have ability set it different like one timezone for the site and second timezone for a user.
So, Drupal keeps the data value in one UTC timezone and it can be converted to any timezone.
Finally, the correct way to get date field is:
<?php
use Drupal\datetime\Plugin\Field\FieldType\DateTimeItemInterface;
// Get the value like a string.
$date = $node->get('field_date')->getString();
// Get the site timezone (for example, it can be a user timezone).
// Or we can omit it and Drupal will use date_default_timezone_get() for it.
$timezone = \Drupal::config('system.date')->get('timezone')['default']);
// Get correct timestamp value.
$timestamp = (new DrupalDateTime($date, DateTimeItemInterface::STORAGE_TIMEZONE))->getTimestamp();
$data_value = \Drupal::service('date.formatter')->format($timestamp, 'custom', 'Y-m-d, H:i:s', $timezone);