Here's my theory, feel free to disagree: Voice comes with decisiveness and confidence, and is built around what you observe that other people do not.
I've definitely had times where I was trying to mimic the "tone" of the people around me. This is embarrassing, but noting improvement is important so I'll share, as a teen I wanted to be feminist, so I echoed a lot of the "yas queen" aesthetic of let's say "Buzzfeed" writing (I'd have characters directly call out other characters for being "sexist" in very plain language, it was not subtle). There's nothing inherently wrong with that aesthetic if that's genuinely what your aesthetic is, but it wasn't ME. I wanted to be reassured that I wasn't a bad person (on a subconscious level, I didn't realize that's why I did it at the time because teenagers are stupid), which is a weak weak weak motivation for writing. It was obviously posturing, and I rightly got called out for it because I was being a worse version of someone that already existed instead of being the best version of myself. I was wearing clothing that quite clearly didn't fit on me. Kierkegaard would have seen me as a case study of inauthenticity. My observations were obvious, making me useless as an "observer".
It's not necessarily "be yourself" so much as it is "find a version of yourself that is confident and use that." Voice comes with conviction. Voice comes with writing something you love, internally, and having the confidence to know that what you love will shine through to the audience.
My advice is to start with a few little things that make you love writing, and cling onto them. For me, I love dialogue. I love writing whole chapters that are almost nothing but dialogue. I just enjoy it. That might seem simple, but that is a stylistic choice. I think there are correct and incorrect ways to write something (i.e. you can have someone with a unique voice but no one knows what they are trying to communicate, and writing is essentially the art of effective communication), but I think what distinguishes voice is what is important to you. What do you notice that other people don't.
Flannery O'Conner was an amazing writer, but she rarely focused on the details of a setting. That wasn't what was internally important to her. Other writers could write a trilogy about a chair in the dining room of a scene they write. Both writers are valid, so long as they communicate clearly and effectively what they focus on, but the focuses are different, making them have different "voices."
To summarize, a big part of writing is "what do you as a writer observe that other people do not?" For me, I notice the cadence and patterns of how people talk, so an emphasis on rhetoric is a huge part of my style. Other people might focus on something else that no one notices. Stephen King talks about how he notices people's physical movements, like chewing on nails.
To summarize, what do you notice that no one else does (what makes you useful as an "observer"), and how can you effectively and confidently communicate that? Find that, and you will find your voice. From there, be authentic.