Please post a lot more info:
• What's your computer specs, especially RAM and GPU? What OS?
• Are your OS, After Effects and GPU drivers all updated to latest versions?
• Which effects are being highlighted in the error messages?
• What are the details of your project - what's the resolution, output file format, which effects are you using? How many layers?
As a temporary workaround, try rendering out to an image sequence. When the render fails you can restart and continue from the last frame rendered. Then, when finished, just convert the final image sequence to your preferred format.