An incentive spirometer can assist with your breathing - using the incentive spirometer will help improve your lung function. In addition, good oral hygiene, sitting up after surgery and getting up out of bed as soon as you can will help prevent pneumonia.
Below is a picture of an incentive spirometer:
This is known as ICOUGH. To see a short film clip about the incentive spirometer please watch this video.