I used to think of being a Christian as not sinning, as trying to keep the Lords commandments, and following the rules He set forth for me - and I kept becoming discouraged because it was boring - the sin seemed to be more enjoyable. I didn't feel the Lord's presence either, which didn't make sense, because I should be drawing nearer to Him since I was working, unlike others, to stop sinning. Through much hardship, toil, and disappointment, our Lord Jesus showed me that when I am trying not to sin, I am failing, because I wasn't made to be more powerful than the forces of evil on my own. So even while I was trying to keep His commandments, He hid himself to me, because I wasn't doing the only thing that matters: following Jesus. While I think about Jesus, I don't think about sin, and it's amazing to me that when I have been doing this for some period of time, I realize I haven't even thought about wanting to sin - because I am wanting our Lord who has no sin.
If we are in a period where God feels distant from us, then it is for our growth, so that He can turn our attention toward Him - fix our complete and total attention only on Jesus. When I feel distracted, and I constantly am being distracted (the world constantly calls for my attention), there are a few things that I do to keep me focused: I listen to Christian music, I read on this forum (deeper fellowship), I read the bible, I talk with other Christians, and most importantly, I talk to Jesus.
Probably more than anything, Jesus wants us to say to Him in the depths of our hearts that no matter how far away He seems or how much we keep messing up, we are not going to turn away from Him. My advice would be to begin with that statement directly to Him - not to yourself, or to someone else, but to Him, and just keep saying it over and over, and it will begin to take hold in your heart.
Take little steps toward Him (no more than you can handle) - it's the little things that make a big difference. If you have a recurring sin that you can't seem to beat, don't worry - He will take it from you in His time. Keep bringing it before Him in humility, asking Him to remove it. If you aren't sure what your sin is, ask Him to show you, and focus on Him. Remember, if we are thinking about our sin, we are not focused on Him, and we will become distracted and keep sinning. Offer a very small part of you to Him, no more than you can handle (when I first started my walk, I decided that I would only listen to contemporary christian music, things like that). With each step we take, He shows Himself to us immeasurably more - so our desire to be apart from Him becomes less every day.
Keep on persevering! The battle is hard, the road is long, but the gifts are that much greater!
Lord Jesus, I pray that you would make this message Your own, and offer another of Yours peace and comfort in Your presence, and guide each and every one of us closer to You, the only thing that matters to us. In your name, Amen.