if you are using nodejs as backend, here are steps to follow
install cors in your backend app
npm install cors
Add this code
const cors = require('cors');
const express = require('express');
const expressApp = express();
expressApp.use(cors({
origin: ['http://localhost:4200'],
"methods": "GET,PUT,POST",
"preflightContinue": false,
"optionsSuccessStatus": 204,
credentials: true
}));