How to be happy alone?

I been dating this guy for about a month. There are things about him that I have reservations about, but I was still with him. So I thought perhaps I was getting to like him more and accepting his flaws. Recently he said to end things cuz it’s not working out, I feel so unfocused at work, I really want the unfocus to stop. A friend ask me if I would say yes if this guy were to ask me to be his Gf, and I realize my answer is no, so perhaps I am just lonely. But I am still in a terrible mood and unable to focus.

I been trying to figure out how to be happy without relying on someone else, advice? Thanks.