We can think God is telling us to do or not do something, but how do we know it’s His voice and not the voice of Satan or a demon?
God Has Spoken
God has spoken through the Apostles and Prophets, and has left us everything we need to know. The Bible tells us how far short we fall of God’s glory (Rom 3:23), how sinful we are at heart (Jer 17:9; Rom 3:10-12), but it also tells us how we might be saved (Rom 10:9-13), so I believe that the cannon of Scripture has been closed and that there is no PS being added today. We are in fact warned about adding to and even taking away from God’s Word (Deut 4:2, 12:32; Prov 30:6; Rev 22:19). The author of Hebrews wrote, “Long ago, at many times and in many ways, God spoke to our fathers by the prophets, but in these last days he has spoken to us by his Son, whom he appointed the heir of all things, through whom also he created the world” (Heb 1:1-2), so God has spoken in the past by the prophets and we have their writings in the Old Testament. Next, God spoke to us in these last days by His Son, Jesus Christ, and you can read that in the New Testament, including the gospels. The “has spoken” is clearly in the past tense, indicating that it’s already been spoken and there is no further revelation to come. Jude wrote, “I was very eager to write to you about our common salvation, I found it necessary to write appealing to you to contend for the faith that was once for all delivered to the saints” (Jude 1:3). Like a package, it was once delivered, and it was also in the past tense, describing a past action that is over. So if you want to know whether it’s God speaking to you  or not, it must match Scripture or it’s another gospel, “not that there is another one, but there are some who trouble you and want to distort the gospel of Christ” (Gal 1:7). You can recognize if it’s God telling you something by recognizing Scriptures pertaining to it.
Not Always Sin
Every human being is like a snowflake; no two are alike, and that’s good because God loves variety. Just look at nature and at mankind and their cultures. The person’s environment too will contribute heavily toward what they think is right or wrong, and will probably differ from a person of another culture, but when Christians come together in unity, they try not to be a stumbling block and not do something they know the other person might be offended by. I remember a story of an old man who for years abused alcohol, but one Sunday night he came forward weeping, heading for the altar, but suddenly the church deacon stopped him and grabbed the man’s pack of cigarettes out of his pocket, and told the man, “Not in here.” Thankfully, the man still came forward and trusted in Christ. After services, the pastor gave the man his cigarettes and apologized for the deacon’s actions. Apparently the deacon felt like it was sacrilege for this man to come into church with a pack of cigarettes in his pocket, even though the old man wasn’t even thinking about it at the time. The point is the old man was a new Christian and had just been born again but the deacon must have felt that he was going to help him clean up his life, but the deacon was out of order. If we think smoking is sin, which most Christians do, the new believer might not be to that point yet. What would they think about C.S. Lewis who smoked a pipe or Charles Spurgeon and his cigars (although he did quit)? It takes time for God to work on people (and us!) and we make a poor imitation of the Holy Spirit. I wouldn’t offer wine to a recovering alcoholic any more than I would offer bacon and eggs to an Orthodox Jewish friend I have. I know alcohol in moderation is not a sin, but its sin for me to drink in front of someone who thinks it is. To them, it might be, and that’s fine. God will convict them if its sin, because anything we can talk them into or out of, someone else can talk them into or out of, but the Spirit is the most effective agent of change in their life. He will convict them, and the world, of sin (John 16:8), not us.
When is it Sin?
When can we know when we are sinning when the Bible doesn’t mention something specifically, like smoking? The Bible does teach certain principles that we can use to judge whether doing something or not doing something is sin. The New Testament focuses on whether it will cause someone harm or cause them to stumble or be offended, and even if it doesn’t offend us, if it offends them, then that is sin to us. We know that not doing the right thing, when you know it needs doing, is sin (James 4:17), We are under grace and have freedom in Christ , “But take care that this right of yours does not somehow become a stumbling block to the weak” (1st Cor 8:9). If we’re not careful, you and I can be “sinning against your brothers and wounding their conscience when it is weak, you sin against Christ” (1st Cor 8:12), so Paul concludes, “if food makes my brother stumble, I will never eat meat, lest I make my brother stumble” (1st Cor 6:13). When you are not sure if something is sin, then that might already be a sign that it is sin. If you weren’t concerned about it, you wouldn’t even think about it, but the fact that some people ask if this is sin or not may be evidence that the Spirit is already convicting them that it’s sin.
The lady that once told me that God spoke to her about divorcing her husband and becoming a missionary must have gotten the wrong message from the wrong person. God would never tell a Christian couple to divorce. You can recognize God speaking to you in a soft, still voice in your mind if you know enough Scripture. Anything that doesn’t seem right may be a red flag. Check it against the standard of truth, the Bible. God will not tell you something that is contrary to His Word; the Enemy would. If you want to know if God is speaking to you or not, get in the Word, find a chapter or verse that relates to that thought and find out what God really is saying, and if they agree together, then it may well be God speaking to you. With the Word of God, we can be sure. We don’t have to guess. We know that “God spoke to our fathers by the prophets” and “by his Son” (Heb 1:1-2), so if you’re not sure, find the Word of God and let God speak to you, because that’s where God speaks most loudly and clearly, and there is no mistake about that.
Something else that might interest you: Are There Still Prophets Today? 
Resource – Scripture quotations are from The Holy Bible, English Standard Version® (ESV®), Crossway Bibles. (2007). ESV: Study Bible : English standard version. Wheaton, Ill: Crossway Bibles. Used by permission. All rights reserved.