My own answer to this would revolve around verifying mutual attraction before you take a big step. Ideally, you want to know how they’re going to respond before you put yourself out there.
If you can’t know or figure it out, people can be amazingly cagey when this comes up, then you need to know how and when to back down once you do take the big step. This is the key to avoiding ruining friendships, always leave a space for your friendship to back into once you’ve thrust your big awkward boner into it.
The gold standard here is what Franklin Veaux would counsel. State your intentions honestly, directly, and completely. “Hey, I like you and I’m interested in pursuing a relationship with you. Are you interested in pursuing one with me?” Leave no room for misinterpretation or obscurity, on either yours or your prospective love interest’s.
For their response, you should treat anything other than an enthusiastic ‘sure!’ as a cue to shut up and start listening to what they have to say. Take everything they say to you at full 100% face value. If you are confused, you will want to ask, in a totally nonviolent way, for clarification. Don’t take anything personally.
I’ve talked myself out of a lot of funtime simply by assuming that what I thought they thought about me is what they actually thought about me. Resist this urge. Clear your mind of your insecurities and let them tell you their perceptions of you.
When they’re done, and be sure to wait until they’re done, then respond. Keep your statements honest, direct, and complete. If you can do this, then you’ll know a lot more about each other at the end of the conversation. Knowing more about someone is usually conducive to a better friendship. Allowing your emotions to turn what could have been a friendly, but serious discussion into an ego-driven argument is the sort of thing that destroys friendships.
As to medium, always face-to-face. It’s nigh-impossible to have this sort of discussion over text.