Why do you use 301 redirects?
Sometimes we have to use 301 redirection from original url to new one. For example, you use https to replace http for you site or change a new domain for current site. So you have to use 301 redirection.
How to make 301 redirects?
If you are using apache server, you can use .htaccess file to make 301 redirection. You also can use php to send a 301 response header to clients to redirect to new page. Hear is an example:
Can 301 redirects affect our site page rank in search engine?
The most important thing we are thinking is whether 301 redirection affect our site page rank in search engine. If yes, we must use it discreetly. Fortunately, 301 redirects can transfer somewhere between 90% to 99% of the SEO authority (rankings, pages indexed, search signals) from the original URL to the new URL. So we can use 301 redirection safely.