Since Typo3 v10, one should use the context API instead of $GLOBALS['TSFE'].
I read this (https://docs.typo3.org/m/typo3/reference-coreapi/10.4/en-us/ApiOverview/Context/Index.html), but can not understand how to come from here to GLOBALS['TSFE']->id
...
I simply do not understand how...
Can someone post an example how to get $GLOBALS['TSFE']->id
?
In all current TYPO3 versions $GLOBALS['TSFE']->id
is still available and the way to go in most cases.
There has been a change in where it's initialized though, so it might be it's not available (anymore) in your case. If that's the case you'll have to add more information about where you want to use it.