Horizon, it's there and we often forget about it when taking photos but it is an important factor in what makes a great image. To help you, remember what Clint Eastwood said, though I'm fairly sure he wasn't talking about photography...
"Keep your eyes on the horizon and your nose to the wind."
Apparently, he said that said the Internet, so it must be true. And I don't care about what you do with your nose, it's the horizon part that really matters here.
It's not easy to hold your phone or camera perfectly horizontal but do make the effort and do your best to have the horizon line straight. There's just something offsetting when you look at an image with a tilted horizon. It can make the difference between an ok photo and a great one.

(The tilted left image doesn't look too good, it's especially important to have ocean horizon straight)
Always try to take your images straight, but that's not easy so it's possible to correct it afterward using editing software or your phone. It's a good practice to check your horizon when editing them and make proper adjustments. Remember that if you correct afterward you will lose parts of the edges, so correcting the horizon may change the composition of your image or, cut important parts of the image.
Here's the best example I have. This was an action shot I took in 2018. When things are moving fast, it's hard to get the horizon straight, throw a ball in the air and a jumping dog in the mix and things get messy real fast. As soon as I try to fix the horizon the ball almost completely disappears from the image which doesn't work.

(On the right, only the highlighted part will end up in the image if I choose to correct the horizon)
Now that being said, perfection is not always the deciding factor in defining what a great photo is. The above is one of my favorite photos I took. It shows a great moment, the tilt makes the viewer feel the action. Never hesitate when things unfold quickly, you're better off having a pile of tilted photos with a gem in them than having none.
As always, this is not a rule but a guideline. Even though a straight horizon will be better in most cases there are exceptions as shown above. One scenario which I sometimes prefer tilted horizon are portraits and action shots. Landscapes on the other hand very rarely feel right with a tilted horizon.
Look below, you decide the one you like best, both portraits are acceptable and good images. I prefer the tilted one but that's only my taste.

Now go have fun taking pictures and keep your camera straight... or not.