To get a ghastling, you must first go to the nether and defeat ghasts, until you get a ghast egg. Then go back to your house and put it in your furnace (to incubate) and then throw it on the floor (You can throw it without using the furnace, but it has a lower chance to spawn a baby ghast). After you got a baby ghast, now its time to take care of him/her.
Ghastlings do not need food, but if you do give them food, then they will grow faster. Without food, they grow slower. All you have to do in this stage, is to feed the ghastling once a minecraft day, until it grows into an adult ghast. Ghastlings do not despawn, because when you hatch them, they're already tamed. They do not hurt you, even if you hit them. I also suggest giving a ghast a place large enough for a ghast to stay in.
After it grew into an adult ghast, it looks 'happier' compared to the normal ghasts. Since you took care of the ghast, now he/she will repay his/her deeds by helping you in new ways. For example, you can now ride a ghast and control it like a tank (except it flies). Also, you can give the ghast 3 commands: stay, follow, and attack (attacks hostile mobs only).