When an outboard motor runs at speed but cannot hold an idle, it usually indicates a problem with the carburettor. Outboard motor designs vary depending on make and model, but all operate on similar principles. Consult your owner's manual to check items that may be unique to your motor. Most manuals come with a troubleshooting guide specific to the product.
Check and adjust the outboard motor's idle settings. Consult your owner's manual -- different models adjust differently. Some simply have an adjustable screw that will set the idle higher or lower. Others require an adjustment directly on the carburettor. In some models, setting the idle while the motor is in neutral will allow it to idle in neutral, but not hold an idle while engaged. In those models, you must set the idle while the motor is engaged.
The carburettor is usually the culprit when a motor will not hold the speed or idle to which it is set. Check the carburettor to make sure it is clean and free of impurities. Check the fuel filter and clean or replace it if it is dirty or clogged. A partially clogged fuel filter can allow the engine to work properly when the flow is full open, but have such a diminished flow in idle that it will die. Check all fuel lines to make sure they are properly attached.
Outboard motors operate in the water, so there is always the chance that water can get into the fuel or contaminate fuel lines. Check to make sure that no water is present in your fuel supply. If water is present, clean the fuel tank and hoses thoroughly, then remove the carburettor and clean it thoroughly before adding new fuel and trying again. If yours is a smaller motor, be sure to use a fuel mix that matches the manufacturer's recommendations.
Check with a boat store that handles the type of motor you have. Contact people who have the same motor that might have had similar problems. You can usually find them in local boating organisations or online forums associated with the outboard motor brand or type of boating you do. Manufacturers of all types of products solicit feedback and encourage forums on their products both to gain information and because real experience is a great tutor -- and often troubleshooter. Take advantage of others' experience. If you still cannot find a practical solution to your problem, take the motor to a professional boat mechanic. If it turns out the problem does not have a simple answer, it often requires rebuilding or replacing the carburettor.