There are De-Nitrate products out there, but really, you should be able to handle them with water changes. If you are sitting at 40ppm now, a 50% water change will bring it down to roughly 20ppm, and so on and so forth. Keep in mind that as you feed the fish, they are excreting waste which will increase the nitrate levels. So you have to stay on top of nitrates and sort of balance the feedings. This is probably how a large majority of fish bought by new fish keepers die - over feeding leading to high nitrates. Keeping the nitrates down around 10ppm would probably be best for the fish - obviously 0ppm is best, but sometimes it's just difficult to maintain that. For corals though you really do want nitrates to stay around 0ppm or below 10ppm.
Others believe that a DSB (Deep Sand Bed) can yield denitrification, but the results are so scattered sometimes that it can be difficult to predict success. Others use Sumps with refugiums and grow macroalgaes and plants that are known to use nitrates for growth. Others still believe that Live rock itself has de-nitrification properties. It has to be large enough in depth to have areas that are anaerobic though - void of oxygen - as this is the only place nitrifying bacteria can grow.
There is a lot of reading material on the subject. I'd do some research and find what method suits your tank/needs best and try to implement that if you wish to achieve de-nitrification.