Trivas is a handy and happy little word, with no neat one-word English translation. It could be described as 'to be comfortable', 'to feel happy/settled' or 'to feel at home'.
If you're a recent arrival in Sweden, expect to be asked Trivs du i Sverige? (do you feel at home in Sweden/are you enjoying life in Sweden?) by your local friends and colleagues. It can be used to talk about feeling comfortable and happy in a place – a country, a city, a house, or any other location – or in an environment, such as a school, university, or a workplace.
The environment doesn't have to be a concrete one. You can say, for example jag trivs i mitt eget sällskap (I'm happy in my own company), jag trivs med att jobba i ett nära team (I like working in a close team), or jag trivs med att hålla många bollar i luften (I like having lots of projects on the go).
You'll also see the noun form, trivsel, for example: det är viktigt att skapa trivsel på jobbet ('it's important to create well-being/contentment at work' or 'it's important to create a positive work environment').
But trivas doesn't have to refer to a person, or even to refer to a conscious sense of comfort and happiness. You can also say things like blåbär trivs bäst i granskog (blueberries grow best in spruce forest), or virus trivs i kallare slemhinnor (viruses thrive in cool mucous membranes). In these cases, it can be helpful to think of trivas as meaning 'to thrive'.
In fact, both trivas and English 'thrive' are descendants of the Old Norse term þrifa, which meant something like 'to clasp/to grasp'. This became þrifask in a reflexive form, first meaning 'to grasp closely to oneself' and later coming to mean 'to thrive'. Danish and Norwegian both use the verb trives in a very similar way to Swedish trivas too.
On a grammatical note, Swedish trivas is a deponent verb, meaning it is active in how it is used, but takes the form of the passive. That's why it has an 's' on the end, which all Swedish verbs take in the passive voice. So the final 's' appears in all tenses: trivs (present), trivts (past perfect) and trivdes (past imperfect).
Jag vill att du ska trivas i vår vackra stad
I want you to feel at home in our beautiful town
Jag har alltid trivts i hans sällskap
I have always felt comfortable with him