If you travel solo, going to cafe's, bars, and especially restaurants can be a bit awkward. But also enjoyable. Mostly, it's just a mental block that people need to get over.
Some venues are really just not designed for solo travelers. You have all these couples and social groups having fun with each other and then the tables they give to social travelers don't tend to be the nicest.
This is annoying if you are hungry and not looking to get another fast food meal. But fast food restaurants are of course perfect for solo travelers otherwise. And there are lots of restaurant types that serve decent food in a bit informal setting where eating by yourself is not that weird. Other good options include hotel restaurants. Because hotels tend to have lots of solo travelers. The bigger the city, the easier it is to find nice places to eat by yourself generally.
Cafes are easier. Lots of people go there to have a coffee by themselves, work, read, or whatever. It's normal. The venue might not like the sub optimal use of tables though. But if it's not too busy and you tip well, they typically don't mind people staying for a few hours and perhaps reading or working on a laptop. I do this a lot.
I don't drink alcohol anymore and getting drunk by yourself in a bar can be a bit weird. Though depending on the bar, it's perfectly normal to have a drink by yourself of course. These days I tend to like to sit down after a day of sight seeing to have a few cold alcohol free beers. Lots of places where this is perfectly normal.
I've been traveling solo for a few decades. I can be quite social but I'm also fine not talking to people for days/weeks when traveling. It's not for everyone. I tend to prefer booking apartments and self catering these days. Going to restaurants for dinner is expensive and not really worth it to me by myself. But I'll have coffees, light lunches, and other beverages.