According to the Bible, God abhors all sex, heterosexual and homosexual, outside of marriage. The temptation to have sex is not inherently sinful—it is the lingering or actual follow-though that is.
God only blesses heterosexual sex through marriage. Marriage is not allowed by God for homosexuals.
For those who may have a sexual attraction toward the same sex, that will need to be a struggle to contain until death if you want to be clean before God. For those who have a sexual attraction toward the opposite sex, stay pure until marriage.
For all who have failed in the above, ask God for forgiveness and endeavor to walk the better path in Him, staying away from the grievous sin to which temptation has previously led you.
Here's another: Confession from a former homosexual