Is it possible to use an algorithm to generate an OTP? I am a software developer, not a cryptologist.

I like the idea of perfect secrecy and would like to use a one-time pad (OTP) to encrypt/decrypt files up to, say, 50Mb.  Is there a way that I can use random number generators and seeds to do this, rather than creating the (very large) pad in advance?

For example, if I used a CSPRNG to create two numbers, then used the first number to seed a (predictable) PRNG, and the second number to determine which number in the sequence to use as the first in the pad, would this still give me perfect secrecy?
This is a standard concept in cryptography, and it is called a stream cipher.

It doesn't give ‘perfect’ secrecy, which is a red herring, but it is the modern standard for how to do cryptography—for example, your web browser is almost certainly using exactly this principle right now to talk to the crypto.stackexchange.com web server, using either AES-GCM or ChaCha/Poly1305, which are authenticated ciphers built out of stream ciphers.

Much more important: Use an authenticated cipher so that a forger can't modify your messages in transit, which can sometimes—like in OpenPGP's EFAIL—have the consequence of losing confidentiality too.