Reading How Emotions Are Made by Lisa Feldman Barret and A Liberated Mind by Steven Hayes will answer your question. More broadly, emotion construction theory and relational frame theory will answer your question.
Self awareness can be seen as set of relational frames. Relational frames are things like “equal” and “opposite”, “I” and “you”, “here” and “there”, “now” and “then” “more” and “less”… Each of relational frame (like “I”, “equal”, “here”, “now”) is like a Lego piece that you can combine with other relational frames (“I am here now”). Piece by piece, frame by frame, thought by thought, you build a sense of self! This is also roughly how feelings are built. Interestingly, your sense of self is not necessarily the same thing as self-awareness; people can believe all kinds of things about themselves and not be aware of them!
You can use self-awareness to examine emotions (e.g. “I notice that I am sad”). You can also create emotions based on your sense of self (e.g. “I failed, and therefore I am sad”). Sometimes, someone’s sense of self does not accept certain emotions (e.g. “Real men don’t cry”), and this rigid and skittish sense of self will do all kinds of things to escape self-awareness. One of therapy’s goals is to shine a light (the light of self-awareness) onto the sense of self, so that people can become psychologically flexible and resilient.