There are primarily two ways to get your hands on a new starship in No Man's Sky, should you decide to go for an upgrade for whatever reason. One of which is the easy but expensive way and the other is the hard but free way. The first method simply involves buying a new ship from a merchant that lands on the space station, which of course requires you to part with a hefty sum of cash to do so. The second method involves tracking down and repairing crashed starships while exploring planets. This route while completely free will require quite a bit of work.
Keep in mind that once you've obtained a new ship, the only items you can transfer to the new ship are resources and tradable goods. Any technology installed on your old ship stays where it is and cannot be moved to the new one. That being said, do not switch ships until you've obtained the Antimatter recipe. You really wouldn't want to be stuck with a new ship without the means to craft warp cells at will.
Now how to find a crashed starship? The first thing you need to do is locate a signal scanner (a small device that emits a beam of orange light towards the sky). These are usually found near outposts, which are in turn indicated as a point of interest ("?") during exploration. Use a bypass chip (crafted using 10 iron and 10 platinum) on the scanner and select "transmission" from the options that appear. This leads to a random waypoint like an observatory or shelter which will always have a round terminal in the main room. Interact with this terminal and some text will explain what kind of signal the terminal has received. A beacon signal usually leads to a new waypoint while a distress signal almost always indicates a crash site. The latter is the one you're looking for.
Solve the number sequence puzzle to receive the exact coordinates to the crash site and go there. These crashed starships will have many (if not all) of components damaged, so you have much to fix before you can claim it as your own. Some already have some nifty (albeit broken) upgrades installed which means you can take advantage of those too once you've fixed them. Also, once you've taken a new ship, it is highly unlikely that you'll come across your old one again after you've left the area. So be absolutely sure you've found the starship you want to keep before leaving.