Don't know how old you are, but if you are over the age of 20 or so...here are some rules I follow when talking to girls that I see on a frequent basis (IE, the gym)
1. Don't be a douche - non-teenage girls don't like douchebags. They like guys with an edge, and it's a fine line, so try not to cross it.
2. Don't be macho - this goes hand in hand with being a douche. Macho-ism is douchey to like 99% of girls. I've never dated a girl who gave a fuck about 1 muscle on my body other than abs, which most of them have all LIKED, but never openly "LIKE OMG I LOVE UR ABZ SIX PAX R SO HAWT" - they won't say this. This goes for weight too, no girl cares about how much you can press, how heavy you are, blah blah blah.
3. Be confident, but short in your first approach - Talk about normal shit with girls you strike conversations with, whether it be in public, the gym, a bar, whatever. It needs to be natural. If you just walk up to a girl and say "I like your purse...." and cue the awkward silence, it's not gonna go anywhere and you are going to be embarrassed as fuck. When I talk to girls at the gym, I legit just introduce myself, ask how their workout is going, ask them general opener questions like how long have they been going to the gym (my gym is pretty new) etc etc. Then I tell them I'll let them get back to their work out and move on. Don't try too hard on the FIRST approach. First approach is key, and it should be really casual. Once you've introduced yourself, if the girl gives you the vibe that she actually doesn't hate the fact that you are talking to her, you can continue to do so in subsequent run-ins wherever you see them on a normal basis. I use the gym as an example because most of us are there like every freakin day so we might as well communicate with others every once in a while, right?
4. Follow up - in the gym setting, or any setting where you are going to see the same person you are interested in on a regular basis, keep in touch with them. Once you have introduced yourself you can start coming up and asking how their day was and start slowly probing into what they do on a daily basis, work, free time, etc. The key is to be gradual about it. Yes it would be fucking awesome if you could just go up and say "Hey my name is Joe, wanna go on a date?" - but that shit probably ain't gonna work on most respectable girls.
5. Seem interested, but not OVERLY interested - Don't come running after the girl in question whenever you see her. That might freak a girl out, so if you do this and all of a sudden she's no longer in the same place at the same time as you....you done fucked up. After you have talked to the girl a couple of times back off and see if she approaches you. Work out in the same general vicinity and if she comes up to you and strikes up the convo for once, then you can assume that she's at least partially interested. At this point play it by ear, maybe she'd be up for getting dinner one day after the gym or w/e.