Melting down coins for their metals has been a practice since coins were first issued. Though there have been decent reasons to melt coins throughout history, the odds are that you're not doing yourself a favor by liquefying your coins.
The only time it ever makes sense to melt down coins is when the face value or collector's intrinsic value of that coin is less than the value of the metal used to make the coin. For instance, in 1979 and 1980, silver prices rose to just shy of $50 an ounce ” an all-time high.  As a result, an untold number of coins with silver content were melted down because their metal was more valuable than the coin's value.
This rarely happens. Generally, coins are worth more in numismatic value than they are when melted down. This is especially true when it comes to the costs of the melting process itself. However, it all depends on the current price of the metal and whether it is high enough to warrant the melting.
In addition to the 1979-1980 skyrocketing price of silver, there are a few other instances where people popularly melted down coins for their metals. In 2011, the price of nickel rose significantly, driving people to melt down American coins with high percentages of the metal.  This is a large part of the reason the United States passed laws making it illegal to melt pennies and nickels.
Historically speaking, there is a direct relationship between the value of a metal used in coin making and the rate at which coins are melted.
It's illegal to melt down coins in some countries. Canada, for instance, forbids the melting down of any Canadian legal tender in the country. Be sure to check in with your country's laws on melting or defacing official coinage before sending your coins off to the furnace.
In the United States, melting non-circulating silver or gold coins is legal. As long as the coin is not in circulation, you can melt it down regardless of its composition.
On September 10, 2020, the value of silver was $26.94 an ounce. That would make the silver in a Roosevelt dime produced between 1946 and 1964 worth $1.94.  However, it is illegal to melt that dime down because it is still circulating as legal tender.
Making nearly $2 by melting a 10-cent coin is a big jump in profit. However, once you take into account the illegality, the cost of the melting, and finding a buyer, your profits will significantly decrease. It's also worth mentioning that an unmelted average-condition 1946 Roosevelt dime sells for around $2. A mint-condition version can bring as much as $20 at an auction. 
In the United States, people who melt down pennies and nickels for profit may face up to $10,000 fines or up to five years in prison. 
These laws also forbid exporting these coins to be melted elsewhere. It's illegal to carry more than $5 worth of pennies and nickels on you when you're traveling overseas.
It's legal to melt non-circulating United States coins, as well as foreign coins in America. However, those importing coins from other countries will have to brave that country's set of laws while their coins are in transit. Commemorative coins such as the Kennedy half dollar and bullion coins such as the American Eagle are legal to melt down, but it's rather pointless to. These coins are more often worth more in their original form.
To put it simply, here's an example: You have one American Eagle gold bullion coin. If you melt it down, you just have gold bullion. The coin is based on gold prices and worth more in its minted form.
In 2019, it cost the United States Mint 2.06 cents to make a penny and 7.53 cents to make a nickel.  This is due to the overhead required to make circulating coins. The metal from these melted coins may be valuable to those who melt them. From a business standpoint, it makes sense that a government would want to ensure the coin stays a coin so that it can stay in circulation.
The value of the metal from melted coins depends on how much that metal is worth on the day you sell it. This is why you generally only see mass melting frenzies when prices for a certain metal are significantly high. You can check the current melt values for coins through online services. 
If you melted down a Kennedy half dollar made from 1965-1970, you would have a piece of silver worth $3.99 if the silver price was $27 per troy ounce. In this example, the more Kennedy half dollars you have and the higher the silver price, the more your hunk of silver will be worth. A roll of 20 coins would be worth $79.86. However, an average-condition Kennedy half dollar in its original form is worth around $5.50 and doesn't require you to melt anything. We advise you to be sure the metal value is high enough to warrant putting in the work to destroy a coin before you start melting.
1. SilverPrice.org. 'Silver Price History,' https://silverprice.org/silver-price-history.html. Accessed Sept. 10, 2020.
2. Statista. 'Average nickel prices from 1980 to 2019,' https://www.statista.com/statistics/236578/iron-ore-prices-since-2003/#:~:text=Global%20nickel%20market&text=By%202011%2C%20nickel%20was%20valued,U.S.%20dollars%20per%20metric%20ton. Accessed Sept. 10, 2020.
3. Coinflation. 'United States Coin Values,' http://www.coinflation.com/unitedstates/.. Accessed Sept. 10, 2020.
4. Cointrackers. '1946 Roosevelt Dime,' http://cointrackers.com/coins/90/1946-roosevelt-dime/#:~:text=CoinTrackers.com%20has%20estimated%20the,%2B)%20could%20be%20worth%20%2420. Accessed Sept. 10, 2020
5. United States Mint. 'United States Mint Moves to Limit Exportation & Melting of Coins,' https://www.usmint.gov/news/press-releases/20061214-united-states-mint-moves-to-limit-exportation-melting-of-coins. Accessed Sept. 10, 2020.
6. United States Mint. '2018 Annual Report,' https://www.usmint.gov/wordpress/wp-content/uploads/2019/01/2018-Annual-Report-ADA.pdf.. Accessed Sept. 10, 2020.
7. Numismatic Guaranty Corporation. 'U.S. Silver Coin Melt Values,' https://www.ngccoin.com/price-guide/coin-melt-values.aspx?MeltCategoryID=2&BaseMetal=US-Silver-Coin. Accessed Sept 10, 2020.