Pets are for life, not just until you don't want them or can't take care of them anymore. If you can't commit to taking care of your dog for it's life time, then IMO, you shouldn't own a pet at all.
But to answer your question, put an ad in the newspaper or on Craigslist to try to find a good home for your dog. Be sure you interview the people extensively to make sure they will take the very best care of the dog. Don't just give the dog to the first person who answers the ad. You need to be responsible enough to make ABSOLUTELY SURE the dog goes to a wonderful family who will love and care for it. If that doesn't work, surrender the dog to a NO KILL animal shelter. And then make sure you don't ever get another pet until you can learn to be responsible for that pet for it's whole life.