Firstly, you will need to talk to the client a lot. Whatever you feel you should ask, then ask. NEVER presume that he wants something. Ask, ask and ask. If you realize that you are boring to the client, there are 90% chances that this is the bad client and you will get into trouble eventually working with such clients. Good clients who want to make success out of their project will always have time for his project. He will never say you are asking stupid question (unless it's really stupid) and he will even repeat things you asked before.
So when he says he wants a website like XY, then he wants such look, UX and impression on users. It's up to you now and your expertize to ask him right questions. Such as: Do you need a backend? Do you have hosting? Do you want linux-based or windows-based website (so you can choose technology and language)? and so on.
You then make a list of all features which will become project specifications. Whatever is not clear, you ask the client. If he says I don't know, you can recommend things.
Always be honest and realistic about deadline. If you followed all these steps and the client leaves you, then you are lucky - you discovered the bad client on time and you did not lose any money, except a few hours of your time.