If you're not the type who willingly exploits in-game glitches, then there are honest ways to make money in No Man's Sky. But it involves patiently mining and loading all your inventory slots with the most valuable resources you can find, then selling them off at galactic trade terminals. Crafting things to be traded also works but that will require quite a bit of patience on your part. Uploading your Discoveries to the online database is another way to earn cash.
These methods are effective but can also be time-consuming. Also, be warned that once your inventory is full of valuable items, flying into space will almost always lead to a space pirate ambush. So it's best to sell your stuff to trading outposts on the planet's surface, rather than going to a space station. Atlas Stones are also incredibly valuable so sell those when you get them.
One other thing up for discussion is the game's economy system, where item prices differ in different parts of the galaxy. Meaning certain items could cost more or cost less when bought or sold in galactic terminals at different star systems in the galaxy.
This is a component that you can take advantage of for profit obviously. However, it would be best to buy goods from fellow explorers who land on space stations, as they tend to sell their stuff at a much lower price than the galactic terminals. You can then take these new purchases and sell them to the terminals for a hefty profit. This of course involves keeping track of the trade prices in each star system you visit.