I think this topic would of probably been covered in another thread, but I'm new so not too sure.
There is a fine line between confidence and ignorance. If you wanna know how to avoid the friends zone there are plenty of dating gurus you can learn from online, just don't get conned into spending any money on info, most of the best info is free and can be found right
here(seriously). And the best way to learn is through trial and error.
There is too much to cover, but I can tell you what not to do

dont be overly nice, dont act feminine, dont buy them stuff, dont be too emotional, dont drop your life or friends for them, dont give them too much attention, dont be a wuss.