Gradually reduce the amount of time spent petting your cat. After the baby arrives you will have less time for petting. Ensure Puss's feeding area and litter tray are well away from areas needed for preparing baby's meals. Establish a feeding area out of reach of a toddler e.g. on a table in the utility room. When baby arrives, Puss will be curious and slightly wary of the new and noisy arrival so don't panic when he sniffs the crib or hangs around.
Many cats soon lose interest and look for entertainment elsewhere.
Keep the nursery door closed or fit a screen door when baby is asleep, but make sure Puss is not shut in the nursery as well. A baby alarm or intercom will allow you to monitor baby. Keep baby's feeding utensils out of Puss's reach and wipe up spilt baby food before Puss gets into the habit of hanging around and doing it for you. Keep cat food and baby food well separated. If you get tired or irritated, don't take it out on Puss.