Hi Thy!
This is a very good question and you are right, there are some subtle differences.
When I say “I am going to bed” that means I may get prepared to sleep (putting in pyjamas, brushing my teeth, etc.) and then getting into bed.
When I say “I am going to sleep” it means I am going to try to sleep now. I may be in my bed already.
The confusion often happens because many people say “I am going to bed” when they are already in bed. Or one could say “I’m going to sleep” when they mean they are going to prepare for sleep, or they are otherwise not in their bed.
As a rule of thumb, when someone says either of these expressions, you can expect they are about to prepare to sleep whether that is in a bed or not. In your own use, use “go to bed” to mean that you will prepare for sleeping, and use go to sleep to mean you are going to physically try to sleep.
Hope this helps! If you have more questions about expressions in US or UK English send me a message or book a lesson with me on my Teacher Profile!
Best,
Rachel