Go to the Pokemon daycare centre on route 7 and leave a Pokemon you want an egg from with a Ditto (Or two of the same Pokemon) with the man behind the desk. Go outside and you'll notice a man next to the daycare facing the fence. When he is facing away from the fence talk to him and he'll say he fkund an egg from the two Pokemon you left and he'll ask if you want it. Press 'Yes' and he'll give you the egg (If you have space in your party) With the egg walk around (Or ride your bike to move faster) and eventually the egg will hatch.
Just note 2 things.
1. When you leave a Pokemon in the daycare you will have to pay to get it back.
2. If you talk to the man next to the daycare while he's facing the fence, he'll tell you how your Pokemon in the daycare are getting along with each other. If he tells you "The two prefer to play with other Pokemon more than each other" then that means you cannot get an egg with those Pokemon together.