I knew what specialty I wanted to do before medical school. I have a strong personal history with the field with one of my parents. Additionally, one of my relatives is a surgeon so I had some perspective on lifestyle.
As you go through third/fourth year you'll see a variety of styles of medical practice. You'll really figure out at that point what you like and what you don't throughout the day. You should have some idea what you like before that, however. Do you like working with your hands? Are you more cerebral or are you more goal oriented through your day? Do you enjoy seeing primarily well people or primarily sick people? Do you like kids more than any other patient population? do you want to be in clinic all day, everyday?
For me, I love the OR. If I couldn't be in the OR I would rather not practice medicine, tbh. I also enjoy the ICU, bedside procedures, and very sick patients. I like fast-paced, focused clinic visits, and being a specialist is something very appealing to me.