Mine is not advertised as "sure-fire" advice, but it's the way I learned. First, I attended a writing conference. Actually, I attended several of them. This may be too expensive for some of you, but if you really want to learn writing, go to one. There are many good ones out there. Now, it's apparent that most are not currently held in the usual format. But if you're serious about writing, start here. Writing, like algebra, will eventually start to make sense for you. if you keep on. And you'll pick up small tips that you'll incorporate into your writing until they become automatic.
While you're deciding about a conference, start reading. Learn how to plot, with books like James Scott Bell's Plot and Structure. Learn how to catch the attention of the reader by reading Noah Lukeman's The First Five Pages. There are too many books to mention--I have a two-foot shelf of them in my office--but read to learn how to write. And also read books by other authors. Read the good stuff, and imitate it. Read the bad stuff, and avoid it.
Notice that I don't mention editors or agents. If you go to your first conference expecting a contract, prepare for disappointment. If for some reason you do get one, count yourself fortunate. But keep learning anyway. Somewhere along the way, you may make contact with an agent or editor who says they think your writing shows promise. Even if they don't offer representation or a contract, take those words and cherish them. And don't lose the name and number of the person who shows interest. You may be able to come back to them, either with a markedly revised manuscript of the one you showed them or (more likely) another book.
And keep on writing. It's the only way to get there. But even if no one but you reads your work, you'll be the better person for writing it. And that may be enough.