Here's a neat tutorial on it https://gamedevelopment.tutsplus.com/series/how-to-create-a-custom-physics-engine--gamedev-12715
Here's a neat tutorial on it https://gamedevelopment.tutsplus.com/series/how-to-create-a-custom-physics-engine--gamedev-12715