Why is the digitalWrite output low in voltage?

I have tried also the following. no luck.

Is there any chance if you could help me with how to use transistor? I have been trying for a very long time. and my project is due very soon.

Thank you.