Updated:

1. Summon one

/summon minecraft:happy_ghast ~ ~3 ~

It is large, so summon it a few blocks up in open space.

2. Summon with a harness

/summon minecraft:happy_ghast ~ ~3 ~ {equipment:{body:{id:"minecraft:red_harness",count:1}}}

The harness goes in the body slot. There are 16 colors; swap red for blue, white and so on. This equipment format is 1.21.5+.

3. Summon a ghastling

/summon minecraft:happy_ghast ~ ~1 ~ {Age:-24000}

A negative Age makes a baby that grows up after 20 minutes. Add AgeLocked:1b to keep it small. See baby mob command.

4. Add a harness later

/item replace entity @n[type=happy_ghast] armor.body with minecraft:blue_harness

@n picks the nearest entity (1.21+). Use with air to remove it.

5. Ride right away

/ride @s mount @n[type=happy_ghast]

With a harness on, the rider can steer. Sneak to get off. See ride command.

6. Change flying speed

/attribute @n[type=happy_ghast] minecraft:flying_speed base set 0.1

Higher is faster. Use base reset to undo.

7. Raise one from a dried ghast

/give @s minecraft:dried_ghast

Place the dried ghast in water and it slowly rehydrates into a ghastling. Feeding the ghastling snowballs makes it grow up faster.

Troubleshooting

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.