It isn't necessarily wrong or sinful to be lonely, but loneliness can easily lead us astray. From what you say, you should be thankful this relationship came to an end; I doubt if it had any future.
The most important thing I can tell you is that you already have a true friend -- and that friend is Jesus. Others may abandon us or turn against us -- but He never will. He loves you, and He'll always with you once you give your life to Him. How do I know He loves you? I know it first of all because His Word, the Bible, tells us He loves us. I know it also because He willingly gave His life for us. Ask Him to come into your life today.
But God also has other friends He wants to give you -- namely, your brothers and sisters in Christ. Ask Him to lead you to a church where you can grow closer to God, and also can meet people who care about you and will be your friends. The Bible says, "Dear friends, let us love one another, for love comes from God" (1 John 4:7).
God's greatest gift to us is the gift of His Son, through whom we come to know God and receive His salvation. But God also gives us the gift of each other. Don't go down paths that may only disappoint, but follow Christ and His will.