HPlus covered some options and there are more.
3 hours ago, MvGxAce said:
Is there a program to ensure that the game I've created does not get hacked from third party apps
There are programs that make it more difficult, but it can never become impossible. Even the games using the most sophisticated techniques that invest millions of dollars into protections (such as World of Warcraft and League of Legends) still cannot block all of it.
There are many ways to attack a game, and even more are discovered all the time.
3 hours ago, MvGxAce said:
The game is online based but I just recently found out there are hackers. Is there a program I could use to stop this or is it in the coding.
For network games, attackers can attack the protocol. It is trivially easy to break through secure sockets, they only protect during transit; just like armored cars, it doesn't matter how armored the vehicle is when the bag of paper money had been replaced with a bag of fake monopoly money before the armored car was used. Attackers have complete control of the game, they can send whatever data they want through the pipes. Attackers can send data saying the player had aimed perfectly, send data saying the player had moved perfectly, or jumped at the right time to avoid danger, or otherwise send tampered data.
Attackers can also send malformed data through the pipes, so it needs to be verified as well. What happens if you get text string that is enormous, like a player name that is 3MB in length? What happens if you get a packet ID of type -1? What happens if you get a string that says it is length -1? What happens if you have levels 1-8 and someone sends a command to load level 45?
Players have other attacks through the program rather than through the network. Programs called 'aimbots' that read game data or that read screen buffers and send mouse events. Programs that grant unlimited money or free items. Programs or tools that make walls invisible, or that make enemies a highly visible color like neon yellow, or that load a map showing where every player is located.
An effective countermeasure to many attacks is to only tell the client the minimum that it needs to know. Don't say where players are at unless they're being drawn on the screen. If something is outside line-of-sight then it doesn't exist. Give out data on a 'need to know' basis.
Another highly effective countermeasure (which is also costly to implement) is to validate everything that comes from the client and run it all on the server. Trust nothing, and design the protocol so that the client sends requests and the server runs the simulation. If the player says they fired at a location at a time, verify that the player could have been at that location at that time. If the player says the jumped to safety from a place at a time, verify that they could have been at that location at that time. It could say they used a weapon they don't own, or say they bought an item with money they don't have. It could say they sold a rare item even though they didn't own it, or that they killed a monster that wasn't actually there.
Check for statistics. If someone has a very high accuracy, perhaps 100% of their shots are kills, that's probably a cheater. Many online games show a few stats at the end of game to help the community; a player may have 15% hit rate, 20% hit rate. A skilled player may have 60% hit rate. People who have very high hit rates, high frag counts, low death counts, and other unexpected values some games will allow players to flag them as potential cheaters.
Even with all that, there are bugs and defects that cheaters can still exploit. There was an infamous WoW "Corrupted Blood" bug, where a player could acquire a spreadable virus-like debuff, then through various methods bring the virus to a town of low-level players and infect them, leading to mass deaths. Several games have had walls with a slightly errant polygon, a skilled player could stand on that polygon or pixel error to gain an advantage. Some games have had collision errors, where an unusual series of events could place a player inside a wall; they have a perfect shield and can fire at anyone.
No matter what efforts you try exploits will still exist.