The type of algae would be useful. Different algae uses different nutrients, shows up in different situations, and has different specific solutions that will be most effective at getting rid of it. Algae can be green, brown, black, or blue green and can look like threads, fuzz or hair, sheets, spots, and branches.
Are you using tap in both? That will cause huge issues in saltwater. Unless your doing a fish only setup with very hardy fish you should use RO or distilled to mix your salt. If your setup is fish only cut the lighting to practically nothing. A single tube 50/50 bulb on 8hours or less per day is good. For freshwater if you have no plants you can cut the light almost completely. Only turn it on when your home.
Next if you don't have one get a nitrate test. Nitrates on saltwater tanks should be pretty much untestable. In a fish only tank with little liverock you will likely see 5-10ppm but it should never be any higher and lowering it will help. Adding more rock will increase denitrification and may allow you to cut back on water changes some. In freshwater you want nitrates at minimum below 40ppm for the safety of the fish but to combat algae and keep the fish at their healthiest 20ppm or lower is best. In freshwater your only good options for nitrate control are add plants or do more water changes. Testing kits are one of the best things you can have around for your tank even if you don't use them frequently. I suggest a full liquid master kit (don't ever rely on strips) but at least get an aquarium pharm saltwater/freshwater nitrate test. It's less than $10 and will last a year.
If nitrates aren't too high your next plan for nonplanted, no coral tanks is to get phosphate removers or for brown algae silicate removers. There are safe phosphate removers for tanks with corals but going with the RO water and extra water changes to remove the phosphates is a much safer and more effective solution. Phosphate removers are just easier.
A solution for some algae is to increase water movement. Many prefer dead areas in the tank. Adding a powerhead or second filter will often circulate the water enough to discourage algae growth and is nearly always beneficial to the inhabitants. Especially true in a saltwater tank.
Last ditch attempt if the algae won't go away is to blackout for awhile. Cover the tank in black paper or plastic, don't turn on the aquarium lights, and keep it as dark as possible for several weeks. Remove the algae every few days as it dies so it doesn't pollute the tank. This will remove stubborn algae outbreaks. The reason this isn't a first step is if you haven't solved the problem such as less light, less nitrates, and less phosphates with more water changes the algae will be back in a few weeks. It will kill the algae currently living in the tank though so you can get ahead of it.
Now if we're dealing with planted tanks that's an entirely different story and would require more info including species and number of plants, lighting and duration, and type of algae.