After I flush my toilet it sounds like sa freight train while filling up. What is causing the problem
This can be caused by either a worn rubber or neophrene washer in the WATER REFILL VALVE (also known as the ballcock valve), or a worn washer in the on/off water supply valve directly under the toilet tank.
Vary the position of the water supply valve under the toilet to see if the noise changes, or goes away; make sure this valve is FULLY OPEN.
If it's not the water supply valve, it's probably the water inlet valve/ballcock inside the tank.
The sites below have diagrams of the different parts inside the tank, and how they work.
The water refill valve/ballcock comes into play only AFTER you flush the handle, after the water is evacuated from the tank, and the tank starts to refill with water.
Check inside your tank and the diagrams at the sites below to make sure you have a ballcock (rather than some other type valve); the ballcock can be repaired if you can find the correct washer replacement kit at Home Depot/Lowe's, or a plumbing supply house.
Most people just shut off the water supply under the toilet tank, drain the tank water, and replace the ballcock with a non-siphon Fluidmaster 400A series valve (HD/Lowe's), which costs ~$5-$7.
The Fluidmaster also lets you get rid of the float ball.
Start with the 3rd site below; scroll down to the "troubleshooting guide" for noise problems; also follow the links to "tank problems" or "refill problems".