My Mac is beeping 3 times every couple of seconds when it starts Here is what happens, I have 5-10 seconds to do stuff on my computer, then it turns off, turns back on again and attempts to load or something, then turns off. then eventually after enough on and offs, it goes to a white screen and beeps 3 times every couple of seconds, I searched it up, and it definitely doesn’t beep every 5 seconds but a little less than that. This only stops when I press the power button.

Note that I don’t know much of my computer, and I haven’t tampered with anything on the inside or inserted anything into the disc slot or anything. But from what I remember it is osX
That does sound like "Three successive tones, then a five-second pause (repeating)", which according to Apple, suggests that the RAM has not passed an integrity check.

https://support.apple.com/en-us/HT202768

You mention a disk slot, so it's likely quite an old Mac. The last models with optical drives were c. 2012, I think.

Either way, it's a hardware problem that needs hand-on, physical inspection by someone competent. See if there's a local guy who does Apple repair work. (The Apple Store may say it's too old, but it's worth a try.) 

It may just need the existing RAM to be reseated or replaced. Or it may be a problem with the main circuitry: in which case it's time to go shopping.