Harmony is a noun that means "simultaneous sounds." ConsonanceConsonant and dissonancedissonant are adjectives that describe harmony; think of dissonance as "tension" and consonance as "stability/release."
In terms of composing a song, you'll often want your harmonies to match what's happening in the lyrics. If a song ends "happily ever after," it doesn't make much sense for it to end with a dissonant (=full of tension) harmony, does it? Similarly, if the song ends with a major disruption in the lyrics, it might be nice to end with a slightly dissonant chord. If your song is a story of turmoil moving to triumph, you could tell that story with the harmonies by progressively moving from dissonance to consonance. These examples are pretty one-dimensional, and the best music is much more nuanced than this, but they give you a decent starting point.
Lastly: Colloquially, "harmonious" has come to mean something like "consonant," and every once in a while someone (typically a non-musician) will say "harmony" and mean "consonance." Just be aware that sometimes people use these terms interchangeably, even if they're incorrect.