What happens if a MP leaves parliament? Do they get replaced?
Yes, you’re right! If a member of the House of Representatives resigns or dies between federal elections, they will be replaced in a by-election. A by-election is a an election held to fill a single vacancy in the House of Representatives outside of the regular 3-year election cycle.
Casting a vote for the House of Representatives.

Australian Electoral Commission
Description
A green ballot paper is put into a ballot box labelled 'House of Representatives/GREEN/Ballot Papers'.
Permission should be sought from the Australian Electoral Commission (AEC) for third-party or commercial uses of this image. To contact the AEC email: media@aec.gov.au or phone: 13 23 26.