No, you have not lost your salvation, if you have truly given your life to Jesus Christ and trusted Him alone for your salvation. God's promise is that nothing "will be able to separate us from the love of God that is in Christ Jesus our Lord" (Romans 8:39).
Think of it this way. When you were born, you became a member of your family. No matter what happens, that relationship will always exist; you will always be your parents' child. At times they might get upset with you (or you might get upset with them), and when that happens your fellowship with them will become strained. But even then you are still part of that family.
This is like our relationship with God. You see, when we come to Christ, the Bible says we become members of His family: "You are all sons of God through faith in Christ Jesus" (Galatians 3:26). If you have given your life to Christ you are now God's child, and nothing can ever change that relationship. When you sin, your fellowship with God will be broken — but not your relationship.
Sin is serious, because it breaks our fellowship with God. But God still loves you, and He yearns for you to come back to Him. Confess your sin to Him and accept His forgiveness today. Then learn to walk with Christ every day through prayer, the Bible and Christian fellowship.