How to get logged in userid?

Edited:
Hi @roman.smirnov

We have already used this. Here is the code snippet:

When we run it, we are getting a NullPointerException!!