I got out of a 3.5 year relationship a little bit ago. I can only remember the good and my friends constantly remind me how miserable I was. I don’t understand how I can only seem to think about the good and I constantly miss him when I was miserable
Well there's different reasons as to why you're going through this.
First, it was a long term relationship so he was in a good portion of your life. It can be hard getting used to the fact that you aren't with him anymore. Adjusting does take some time but keep in mind the end goal is to move on from him because you know he isn't good for you. You were a person before you met him. You can still be a person after him.
Second, you're having feelings of loneliness now because you are trying to adjust. Our minds play tricks on us when we're lonely. We can try to convince ourselves that someone wasn't really bad at all but you have to just keep reminding yourself of the bad things he did. Everyone has good in them but the good isn't enough when the bad is pretty significant to the point you were miserable during the relationship. 3.5 years is a long time for someone to prove who they are and he's proved to you he isn't good for you.
Third, you need to keep yourself occupied but in healthy ways. There's a lot of healing that needs to be done. Sometimes our coping mechanisms aren't the best when dealing with breakups and that's what makes it harder. You can refer to my post about dealing with breakups here. It's about how to find yourself after a breakup because that's probably something you're having trouble with right now.
Fourth, when someone is toxic, abusive, manipulative, or anything else negative he could've been to you, it's almost enough to convince you that you don't deserve better. You need to build self esteem because he took that away from you. Think about what good qualities you have and what qualities you would want in a man. Think hard about what would be good for you. You should want someone who encourages you and works with you to be better. A relationship should be about two people who contribute to each other in beneficial ways that are long term improvements.
Lastly, you don't want to be in the same cycles so you need to go over what you learned from your last relationship. What are some things you want to avoid next time? What are the qualities in him that you didn't like so you don't date someone similar to him next time. What are some things you may need to change? Take some time to self reflect about what could've caused the relationship to fail so that you don't go through something like that again.