Death thoughts

So today my parents argued. I can’t really detail it, but it is complicated and upsetting. I’m only able to know what I listen in on as my mother just says not to worry or ask.
I went out for a walk and just walked down the middle of the road for a bit. All I could think was ” just do it. Walk into the road. Just die”
I feel a little like I’m just making up these thoughts, but you can’t force yourself to think like that. It made me tearful and feel stupid for thinking something so insane.
What on earth am I doing?