Well, tone is in your fingers is what a lot of people say, and while that's true, i think it should never be confused with what good gear can do because in my opinion they're two very different things.
I used to always play with pretty uninspiring tone because i couldn't afford any good equipment and it held me back a lot as a musician honestly. What changed that for me was Neural DSP - best amp plugin, by far, that i've ever used. It's so nice to always be able to just play a single note and feel excited with what you hear; now i can't believe i've played for so many years and rarely getting that feeling.
I find it hard though to tell anyone specifically how i build a guitar tone since there are so many variables that are unique to every player. But a general thing i do is try to keep compression and gain as low as possible while still getting a heavy sound, because i find that too much of it makes for a kind of lifeless and dull tone. It's just a lot of listening and tweaking for me until it sounds good, which is something i learned to do when studying audio engineering.
So in conclusion: how i get my guitar tone is by using high quality and inspiring gear, and working on my listening skills as well as my fundamental understanding of the gear i use.