“But you, when you pray, go into your inner room, and when you have shut your door, pray to your Father who is in secret, and your Father who sees in secret will repay you.” Matthew 6:6 NASB
Jesus is declaring that prayer is a personal conversation with God and not a public show to impress other people. Prayer is primarily a private communion with the Father. The “inner room” is a place that is shut off from all distractions.
It is where the righteous can talk to and with the Father. From the overflow of private prayer, the righteous can speak to God in public worship. Prayer, private or public, is an essential part of worship. Even during public prayers the righteous will be focused on God and not on other people.