I am Making Bubble Shotter game in which bubbles get blast when 3 same colors get to gather . How can i detect neighbouring objects?

DO i need to raycast in all direction to get all information about neigbours or CircleCast will do that thing?
The game is in 2D

If you store your objects first in an array, you can use a foreach on that array of objects calculating distance using Vector3 distance and the closest objects would obviously be the neighbors. You could also just using something simple such as OnCollisionStay or in 2d it would be OnCollisionStay2D.