Yes, you can use an external keyboard with your Android phone. There are a few different ways to do this, and the best way for you will depend on what type of keyboard you want to use and what type of phone you have.
One option is to buy an OTG adapter and connect your keyboard directly to your phone. This requires a USB OTG-compatible phone, and not all phones are compatible. Check your phone's documentation or manufacturer to be sure. If your phone is compatible, then you just need to connect the adapter to your phone and then plug in your keyboard's USB cable. The keyboard should then work normally.
Another option is to use Bluetooth to connect a wireless keyboard to your Android phone. This works with any Bluetooth-enabled keyboard, but it does require that both devices have Bluetooth turned on and be paired together before it will work. To pair them, just put the two devices next to each other and follow the prompts on both screens until they are paired together wirelessly. Once they are paired, the keyboard should work just like it would if it were connected directly to your Android device via USB.