You can use the sides of the camera’s viewfinder as a guideline - or if you like, you can turn on your camera’s grid setting (you may need to refer to your camera’s manual to find them. It looks easy, but you’ll need to practice. If you aren’t succeeding, it’s probably due to one or two things (or both):
You can practice on a bookshelf, a building, windows or doors, or anything with vertical lines. If your scene/subjects include vertical AND horizontal lines, focus on the vertical ones.
The suggestions above are quite obvious choices, but look at any account on Instagram with many followers, and you’ll notice that the photographers always pay attention to the lines. Both professional photographers and film makers pay attention to straight vertical lines. I know it’s one more thing to think about, but it will make all the difference to your photos.