How can I keep my pops happy and avoid constant unrest
Solution 1:
I think you're missing a few key (but subtle) features of the game that are hindering your happiness management. Stellaris has many interconnected moving parts.
If you come from Civilization-like games to Stellaris, the amount of stats and control you exert over your empire is a bit daunting. I suspect that you may have been glossing over a few new elements that aren't common in other 4X games.
- Planet habitability is a happiness cap.
Every planet has a habitability score. Your species' homeworld is 100%, other planets of the same type as your homeworld are 80%, the other types in the same category are 60%, other categories are 20%, gaia worlds are 100%.
If you settle a planet with 20% habitability, that 20% becomes the cap for happiness. Even if you do everything right and your citizens should be running at 60% happiness, their happiness will be capped at 20% due to planet habitability.
Low habitability has more drawbacks than just happiness, but happiness is the most relevant for this question.
In the beginning, you only want to colonize planets of >50% habitability because you lack the tech to improve the planets. When you unlock the tech, you can terraform planets to change their habitability.
Robotic populations get a flatout +200% to habitability so that they are not affected by planet habitability. If there's a low-hab planet with plenty of minerals on it, you could establish a robot population there instead of an organic one.
More info on habitability can be found on the wiki.
- You can only control a limited amount of core sector worlds.
This means planets that are under your direct control. The default is 3, though there are trait, traditions and techs that can seriously increase that number.
Note that this is a soft cap. You're able to colonize more planets than your cap allows you to, but you suffer a penalty when you do. According to the wiki, the penalty is for influence and energy; but I wouldn't be surprised if this can indirectly influence population happiness too.
It is possible to colonize more planets than your core sectors allow, but you have to assign them to sectors (think of it as provinces of your empire, with a local governor). Any planet that is assigned to a sector no longer counts as a core sector planet. Mineral and energy gains from a sector are lowered (you can regulate the tax on them), science and resources are given to you without a reduction.
The wiki page has more information on both core systems and sectors.
- Population that belongs to a faction has a base happiness equal to that of the faction.
Before modifiers are applied, every pop starts off at 50% happiness. However, if a pop is part of a faction, it will start off at whatever the faction's happiness is. If you spend no effort on keeping your factions happy, your pops are going to be rather unhappy.
On top of the base happiness, there are a ton of modifiers that can influence the final happiness rating of a pop.
The most common negative modifiers come from: planet modifiers, being enslaved, badly chosen civics and rights, starvation.
The most common positive modifiers come from: planet modifiers, ruler traits, buildings, edicts, traditions.
More information on happiness on the wiki.
- Stellaris has an in-built wiki browser for a reason.
I'm not trying to be a hard-ass here; but I do feel it's relevant to address this. If you click on the question mark button (bottom right of the game screen), it will open an in-game browser to the Stellaris wiki.
The game has so many features and stats that it's hard to keep everything apart from time to time, especially in your first few campaigns.
I've played for 60+ hours and I still regularly use the wiki when I'm unsure of something. Most of what I have told you in this answer comes from reading the wiki, more so than anything else.
The wiki is of course also available outside of the game.
Solution 2:
Happiness is determined by your species compatibility with the planet they are on. Your populations may be unhappy if you are settling unsuitable planets for your species habitability type.
When settling new planets (particularly in the early game) always aim for the ones with the green icon rather than a red or yellow one as this means it is more suitable for your species.
There are a lot of factors which can affect happiness (I recommend reading that section of the wiki fully) but some which may be an issue are starvation and influence deficit which provide empire wide decreases in happiness, so make sure you are producing enough food and haven't decreased your influence too much with edicts or building frontier outposts.
You may also want to check that you haven't got any traits on your species that affect habitability or happiness negatively.
Solution 3:
I personally think there are greater underlying issues to this question, potentially involving your empire basis with civics, traits, government type, and ethics. I recommend looking into this as a possible source of your issue.
To answer your question on quelling unrest however, you can do this primarily by having defensive/offensive armies stationed in the planet's garrison. The more armies present, the more the unrest level will drop. Side methods include certain techs, traditions, planetary and empire edicts, and species traits.