Definition of Brahman according to Taittiriya Upanishad:
Brahma-vid apnoti param, tad eshabhyukta, satyam jnanam anantam brahma
(Tait. 2.1.1)
Source: Taittiriya Upanishad 2.1.1 - definition of Brahman
Satyam: Truth; jnanam (or Gyanam): All knower; anantam: It is everywhere, infinite.
Source: Translation of Satyam jnanam anantam
SAT (or Existence for Truth): What is the cause of truth? Existence of something. The existence of you, me, the universe, or literally any physical or non-physical (like thoughts, emotions, feelings, etc.) establishes truth. For anything to be true, it MUST exist. Hence, the existence of something is the source of its truth.
Chit (or Consciousness for gyaanam): How is the truth known? (or truth becomes gyaan), It is by consciousness. It MUST be percieved via consciousness for the truth to become gyaan. Hence, consciousness is the source of the knowledge (or jnanam).
Anandam (or infinite for anatam): The brahman is anatam or infinite. It means it MUST have no three limitations: 1. Spatial limitations: It is not limited by space. 2. Temporal limitations: It is not limited by time (he is timeless) 3. Attribute limitations: It is not limited by attributes (such as color, shape, etc.)
Hence, the only thing that is not limited by anything, and has the consciousness to perceive the truth is self (the consciousness that witnesses thoughts, emotions, intellect, mind, sensory organs, etc). A deeper exposition of the same is given here: Definition of Brahman: Sat-Chit-Ananda. The one who has realized the self (source of brahman), becomes jivanmukta or liberated or brahman himself (Tait. Upan.)
Bhagavad Gita
The offering is Brahman; the oblation is Brahman; offered by Brahman
into the fire of Brahman. Brahman will be attained by him, who always
sees Brahman in action. – Hymn 4.24
He who finds his happiness within, His delight within, And his light
within, This yogin attains the bliss of Brahman, becoming Brahman. –
Hymn 5.24
If everything is of brahman, then how come there are good and bad
people?
To answer this question, you need to dive into Ashtavakra Gita, who was the guru of King Janank (whom Krishna praises in Bhagavad Gita and inspires Arjuna with him).
1.4 Abide in Awareness with no illusion of person. You will be instantly free and at peace.
1.5 You have no caste or duties. You are invisible, unattached, formless. You are the Witness of all things. Be happy.
1.6 Right and wrong, pleasure and pain, exist in the mind only. They are not your concern. You neither do nor enjoy. You are free.
1.7 You are the Solitary Witness of All That Is, forever free. Your only bondage is not seeing This.
Ashtavakra Gita
Brahman (or real self), that is not situated in the body, is beyond all good and bad. It is beyond that has attributes (right/wrong, good/bad, win/loose, hot/cold, etc). Attributes are the consequence of Maya that is the very nature of existence.
O Kesava, [ Kesava means the manifested Logos, the union of Visnu,
Brahma and Mahesvara, or the combined Sattva, Rajas, and Tamas Gunas.
The word "Kesava" is from Ka-isa-va] tell me the knowledge of that
Brahman that is One, and without its like and rival, without Upadhi
(attributes) beyond the Akasa, source of all purity, that which cannot
be approached by argument, or reached by conception, the unknowable
and the unknown, and that which is absolutely free from births and
deaths. O Kesava, impart to me the knowledge of that which is
Absolute, the only above ode Eternal Peace and Purity, the
Instrumental (Nimitta) and Material (Upadana) cause of the Universe,
though itself causeless and free from all connection. Tell me, O
Kesava, the knowledge of that which dwells in every heart, and that
which combines the fact of knowledge and the thing knowable in Itself.
Arjuna to Krishna. Uttara Gita, Chapter - 1, verse - 1,2 and 3.
The existence of Maya is self-established, just like Brahman. It is only due to delusion (or avidya) appears like objects with attributes (good/bad, hot/cold, red/black color, gold or copper etc). When Brahman is realized (enlightened), he starts treating duality as the same - treats all good and bad people well, eats all good or bad tasting food, whatever it is provided to him, and sees everyone the same, good people or bad people. This can be achieved through the path of karma yoga, bhakti yoga, gyan yoga, or raja yoga.
Krishna talks about the first three in the Bhagavad Gita, Gyan yoga in the Ashtavakra Gita, and the path of meditation, tantra in Uttara Gita. Yoga sutras of Patanjali discuss the Raja Yoga path.
Liberation is simply realizing you are in a dream of self (everything in life) and waking up from it.