2014 Toyota Tundra air conditioning

a/c will get cold then stop working and sometimes stars making loud noise can hit the dash board and will come back on sometimes

Do you mean the fan that blows the air through the vents stops?
Odd for a 4 YO vehicle but something may be causing the fan to bind or the bearing/bushings are failing.

Thats very odd on a 4 year old vehicule to do this. My 19 Year old Corolla is still blowing cold air like the day I bought it.I only had to replace the blower motor on it because it was getting noisy. Contact your dealer ASAP